You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the brew repo, I would like to our non-vendored .rbi files (Sorbet's "Ruby Interface" files, written in Ruby) to be covered by RuboCop. However, I just noticed that our configuration wasn't behaving as expected.
In particular, I'm seeing that this configuration:
AllCops:
Include:
- "**/*.rbi"
is less inclusive than this one:
AllCops:
Include:
- "Homebrew/**/*.rbi"
As a demonstration, this PR leads to these violations, although there are no violations on the base branch.
Expected behavior
**/*.rbi should be a superset of Homebrew/**/*.rbi
Actual behavior
Homebrew/**/*.rbi includes files that **/*.rbi does not (I'm not actually sure the latter is including any files)
Steps to reproduce the problem
See the config file and PR run linked above. I don't have a more minimal repro available, but could attempt one if needed.
RuboCop version
Include the output of rubocop -V or bundle exec rubocop -V if using Bundler.
If you see extension cop versions (e.g. rubocop-performance, rubocop-rspec, and others)
output by rubocop -V, include them as well. Here's an example:
What ultimately causes this behavior is that File.fnmatch('../**/*.irb', 'Homebrew/file.irb', File::FNM_PATHNAME | File::FNM_EXTGLOB) returns false. This is a bit unexpected if you ask me, but that's how it is and we must adapt to the fact. I'll try to provide a solution.
The ../ in the pattern - in case you're wondering - comes from the fact that Library/Homebrew/.rubocop.yml inherits from ../.rubocop.yml and in configuration files that begin with .rubocop, we interpret include/exclude paths as being relative to the file itself, rather than relative to the current directory.
In the brew repo, I would like to our non-vendored .rbi files (Sorbet's "Ruby Interface" files, written in Ruby) to be covered by RuboCop. However, I just noticed that our configuration wasn't behaving as expected.
In particular, I'm seeing that this configuration:
is less inclusive than this one:
As a demonstration, this PR leads to these violations, although there are no violations on the base branch.
Expected behavior
**/*.rbi
should be a superset ofHomebrew/**/*.rbi
Actual behavior
Homebrew/**/*.rbi
includes files that**/*.rbi
does not (I'm not actually sure the latter is including any files)Steps to reproduce the problem
See the config file and PR run linked above. I don't have a more minimal repro available, but could attempt one if needed.
RuboCop version
Include the output of
rubocop -V
orbundle exec rubocop -V
if using Bundler.If you see extension cop versions (e.g.
rubocop-performance
,rubocop-rspec
, and others)output by
rubocop -V
, include them as well. Here's an example:The text was updated successfully, but these errors were encountered: