-
-
Notifications
You must be signed in to change notification settings - Fork 272
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proof of concept separation of departments #1476
Conversation
@@ -12,3 +12,20 @@ changed_parameters: | |||
parameters: IgnoredPatterns | |||
alternative: AllowedPatterns | |||
severity: warning | |||
|
|||
renamed: |
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.
@@ -37,7 +35,10 @@ | |||
|
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.
require_relative 'rubocop/rspec/factory_bot'
above is needed by both the extracted (RSpec-agnostic) and the remaining (RSpec-specific) FactoryBot cops.
@@ -47,7 +48,7 @@ def replace_nil(config) | |||
end | |||
|
|||
def reference(cop) | |||
COP_DOC_BASE_URL + cop.sub('RSpec/', '') |
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.
Any idea why this was needed?
@@ -32,10 +32,7 @@ def initialize(yardoc) | |||
# | |||
# @return [Boolean] | |||
def rspec_cop? | |||
class_documentation? && |
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.
Replaced with an argument YARD::Registry.all(:class)
.
@@ -32,10 +32,7 @@ def initialize(yardoc) | |||
# | |||
# @return [Boolean] | |||
def rspec_cop? | |||
class_documentation? && | |||
rspec_cop_namespace? && |
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.
We only load our classes using a glob, why would we check if it's really ours?
'{capybara,factory_bot,rspec,rspec-rails}', | ||
'{,capybara,factory_bot,rails}', '*.rb') |
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.
Not perfect. Could probably be '{capybara,factory_bot,rspec,rspec/capybara,rspec/factory_bot,rspec/rails,rspec-rails}
, but it's not platform-independent. Do we care about other platforms (that one with \
file separator!) running our tests?
I'm closing this one and will make another iteration going further, with putting all the prospective gems in separate directories, with own gemspecs, lib, spec etc. |
See discussion
馃攷 better viewed without indentation changes
I went too far, as renaming cops is a breaking change:
This way it would be a breaking change. And we could only afford this in 3.0.
But then, when we'll decide to actually extract them, we'd have to release 4.0.
And when RuboCop 2.0 is finally released, and if we decide not to sync our 3.0 and 2.0 with it, we'll have to release 5.0. Just because they will enable their pending cops.
What do you think of such a series of major updates?
Not done
RuboCop::RSpec::FactoryBot::Language
is used by both the extracted (lib/rubocop/cop/factory_bot/create_list.rb
,lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb
) and the remaininglib/rubocop/cop/rspec/factory_bot/syntax_methods.rb
cops.Too lazy to fix one last spec
Before submitting the PR make sure the following are checked:
master
(if not - rebase it).CHANGELOG.md
if the new code introduces user-observable changes.bundle exec rake
) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).