[build] Separate format and lint tasks, add per-language format commands#17020
[build] Separate format and lint tasks, add per-language format commands#17020titusfortner merged 11 commits intotrunkfrom
Conversation
PR TypeEnhancement, Tests Description
|
| Relevant files | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Enhancement | 12 files
|
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Latest suggestions up to b8eef8a
Previous suggestions✅ Suggestions up to commit 43d2aaf
✅ Suggestions up to commit 6d3d245
✅ Suggestions up to commit 9692ebe
✅ Suggestions up to commit f2b4a25
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Pull request overview
This PR refactors the build tooling to separate formatting (auto-fix, no-fail) from linting (static checks that can fail). The changes introduce per-language format and lint commands accessible via ./go <lang>:format and ./go <lang>:lint, allowing developers to run only the checks relevant to their work.
Changes:
- Separated format and lint tasks with distinct responsibilities and CI placement
- Added language-specific format/lint commands with optional language skipping via
-<lang>flags - Consolidated CI lint workflows to use new unified task structure
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/format.sh | Added deprecation notice, removed dotnet and copyright sections, fixed Ruby formatting to use new lint target with fail-level flag |
| rake_tasks/rust.rake | Split lint task into separate format (rustfmt) and lint (no-op) tasks |
| rake_tasks/ruby.rake | Split into format (rubocop -a) and lint (rubocop + steep + docs) tasks, separated docs generation from staging |
| rake_tasks/python.rake | Split into format (ruff format) and lint (ruff check + mypy + docs) tasks, separated docs generation from staging |
| rake_tasks/node.rake | Split into format (prettier) and lint (eslint + docs) tasks, separated docs generation from staging |
| rake_tasks/java.rake | Renamed lint to format, added new lint task that only runs docs generation |
| rake_tasks/dotnet.rake | Enhanced format to include style, added comprehensive lint task with analyzers and style checks |
| Rakefile | Created top-level format task with copyright/buildifier/rust, refactored lint task, added language aliases and skip logic |
| .github/workflows/ci-ruby.yml | Consolidated separate docs and type-check jobs into single lint job |
| .github/workflows/ci-python.yml | Removed separate docs and typing jobs, consolidated into lint job |
| .github/workflows/ci-lint.yml | Replaced check-format.sh with inline ./go format command |
| .github/workflows/ci-dotnet.yml | Added new lint job for .NET |
Use Bazel.execute and Dir.glob instead of shell backticks and find/xargs for Windows compatibility. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use Bazel.execute and Dir.glob for Windows compatibility - Add format_cmd helper to truncate commands with many args - Full command shown when verbose flag is set (DEBUG/SE_DEBUG) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Move "Executing:" output before the platform conditional so both Windows and Unix show the command being run. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Honestly the filtering piece is much less useful if we have #17035 but I'll merge it anyway |
Finally consolidate all the lint work into one cohesive thing.
Both Ruby & .NET can take a long time to run format.sh (several minutes), and are unnecessary if you're doing Java or Python work, so helpful to filter
Right now we're mixing formatting and linting a little bit, and this clarifies the intent.
💥 What does this PR do?
Separates formatting and linting into distinct tasks with clear responsibilities:
Format tasks (explicit format/spacing things, auto-fix, no-fail, run in ci-lint.yml):
./go format- buildifier, copyright, rust, all language formatters./go <lang>:format- language-specific formatting./go format -<lang1> -<lang2>- skip one or more languagesLint tasks (static checks, fix-if-can, run in language-specific CI):
./go lint- actionlint/shellcheck + all language linters./go <lang>:lint- linters, type checkers, docs build verificationdocs_generateto verify docs can buildPer-language lint includes:
CI changes:
ci-lint.yml: actionlint GitHub Action +./go formatci-python.yml:./go py:lint(removed separate docs/typing jobs)ci-ruby.yml:./go rb:lint(removed separate docs job)ci-dotnet.yml: added./go dotnet:lintformat.sh changes
🔧 Implementation Notes
bazel test //<lang>/...💡 Additional Considerations
scripts/format.shstill works but suggests./go format🔄 Types of changes