Consolidate RuboCop configuration - #6162
Conversation
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 6f01ad5 | Docs | Datadog PR Page | Give us feedback! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e974d91f89
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
e974d91 to
06bab91
Compare
2b7dc17 to
6f01ad5
Compare
| - Using alternate gemfile: `BUNDLE_GEMFILE=$(pwd)/gemfiles/<name>.gemfile`. For running matrix-specific jobs. | ||
| - Smoke verification: `bundle exec rake test:main`. Baseline general testing (no native or integration testing). | ||
| - Lint and type check: `bundle exec rake standard typecheck`. | ||
| - Lint and type check: `bundle exec rake rubocop typecheck`. Prefer RuboCop because it checks a strict superset of the Standard rules; CI requires both, which can be run with `bundle exec rake standard rubocop typecheck`. |
There was a problem hiding this comment.
IMHO we should encapsulate this with our own rake task that is underneath using whatever. It will make instructions stable and hide implementation details. We still can point to some details somehow different, but I think 2 times adjustments already shows us - we might change it 3rd time
There was a problem hiding this comment.
We could indeed have something like a task :check => [:standard, :rubocop, :typecheck] and be done with it but then we'd be discussing the exact namespace and scope of what it should run...
In this PR I tried to stay focused on bridging the gap and minimise the changes by not introducing anything new. Agents don't really care about whether it's a single task or multiple anyway.
So I think this is a task for another PR.
What does this PR do?
Consolidates custom-cop configuration and Standard overrides into
.rubocop.yml, making it the single RuboCop configuration. It replaces the rules-specific Rake implementation withRuboCop::RakeTask, preservesrubocop:fix, removes the obsolete config files, and removes the duplicate RuboCop invocation from the Standard CI job.Motivation:
RuboCop configuration was split across
.rubocop.yml,.customcops.yml, andrubocop/standard_overrides.rubocop.yml. Additionally,rake rubocoponly ran the cops from the override file instead of the normal project configuration. A single configuration and the upstream Rake task remove that special casing.Tracks APMLP-1586.
Change log entry
None.
Additional Notes:
The Rake task is registered only when RuboCop is present because alternate test-matrix Gemfiles intentionally omit the lint dependencies.
How to test the change?
nix develop --command bundle exec rake rubocop standardnix develop --command bundle exec rake spec:custom_copnix develop --command bundle exec rake test:mainnix run nixpkgs#yamllint -- --strict .rubocop.yml .standard.yml .standard_todo.yml .github/workflows/check.ymlnix run nixpkgs#actionlint -- -ignore 'constant expression "false"' .github/workflows/check.yml