-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create automatic documentation based on the cop's descriptions #51
Conversation
861a855
to
47262be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am finding this PR hard to review -
- Seems like the PR is doing much more what the title of the PR states
- In case, it's doing other stuff, can we mention it in the root comment of the PR as bullet points?
- Some commit messages are not stating why the change is needed / have been added
ff2678c
to
c7df15d
Compare
6737850
to
cae89f6
Compare
Import docs generator rake task from Shopify/rubocop-sorbet@76e7634. This allow us to create docs based on the cop's description.
Some cop descriptions still need to be written, and others don't have relatively bad/good examples. So we updated all descriptions and regenerated the docs.
In this way a documentation link will be shown in the Rubygems page.
e5afd40
to
767b90e
Compare
I've updated the PR with your suggestion. Let me know if now everything is clear. |
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec| | |||
spec.metadata['homepage_uri'] = spec.homepage | |||
spec.metadata['source_code_uri'] = 'https://www.github.com/solidusio/rubocop-solidus' | |||
spec.metadata['changelog_uri'] = 'https://www.github.com/solidusio/rubocop-solidus' | |||
spec.metadata['documentation_uri'] = 'https://www.github.com/solidusio/rubocop-solidus/blob/master/docs/cops.md' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice PR. LGTM
- name: Lint files | ||
run: bundle exec rake rubocop | ||
- name: Run tests | ||
run: bundle exec rake spec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm, is this same as - bundle exec rspec spec
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
Lines 13 to 15 in c62eb78
RSpec::Core::RakeTask.new(:spec) do |spec| | |
spec.pattern = FileList['spec/**/*_spec.rb'] | |
end |
After adding the documentation uri to the gemspec we found a typo in the changelog uri too, so this commit fixes the typo.
When we run rubocop, it will raise a tip regaring suggested exentions. Those extensions are not useful for us, so we disabled the tip. Result after running rubocop: Tip: Based on detected gems, the following RuboCop extension libraries might be helpful: * rubocop-rake (https://rubygems.org/gems/rubocop-rake) * rubocop-rspec (https://rubygems.org/gems/rubocop-rspec) You can opt out of this message by adding the following to your config (see https://docs.rubocop.org/rubocop/extensions.html#extension-suggestions for more options): AllCops: SuggestExtensions: false
This commit contains some improvements for the CI: - Renamed from `Tests` to `CI` because it doesn't run only tests. - Removed `bundle install` step because it's already done in `Setup`. - Created single steps for each rake task. Especially the last point is useful because by separating the step/task, we can easily find and fix which task is failing (if any) and fix it.
This commit contains an improvement on the README readability. Previously, all sections of the README had the same importance. Now we created 4 main sections (Getting started, Documentation, Contributing and License) and moved all other sub-sections under the right top-level section.
767b90e
to
55a9f17
Compare
This PR adds the ability to create docs based on the cop's description directly.
To create new docs, run the
bundle exec rake
task, automatically creating all the relative files and checking if the provided examples contain any ruby parsing error.This PR also contains some improvements, not strictly related to the PR topic: