Skip to content
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

Rspec.Aliases in root-level config #2

Closed
wants to merge 1 commit into from

Conversation

sl4vr
Copy link
Owner

@sl4vr sl4vr commented Jun 1, 2020

Rspec.Aliases in root-level config

Pros

  • No need to change anything but RuboCop::RSpec::Language module
  • Should be faster then dynamic matchers since it fully uses of AST matchers

Cons

On the other hand it's pretty inconsistent:

  • Bottom-level configuration for aliases will be ignored in most cases
  • In some rare cases root-level aliases can be ignored. E.g. if project doesn't use bundler and we run rubocop from some bottom-level directory which already has its own .rubocop.yml without Rspec.Aliases. But still no one gonna do that.

Caching

If bottom-level directories have .rubocop.yml and caching is enabled then changing of hooks in top-level config will be ignored. Need to figure out how to handle it properly.

Testing

config context won't work here because aliases configuration is loaded on gem loading and doesn't fully use rubocop config loading mechanism. I think instead it's enough to test just aliases configuration loading though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant