Skip to content

Conversation

@cgrindel
Copy link
Contributor

@cgrindel cgrindel commented Nov 5, 2025

Summary

Add support for Standard Ruby (standardrb) as a Ruby linter alongside RuboCop. This implementation follows the same pattern as the RuboCop integration with full support for linting, auto-fixing, and SARIF report generation.

Standard Ruby is a zero-configuration Ruby linter and formatter based on RuboCop that provides stricter defaults and enforces a consistent style guide.

Implementation

Key Changes

  • Add lint/standardrb.bzl with lint_standardrb_aspect for Ruby linting
  • Update example configuration with standardrb gem dependency (v1.51.1)
  • Add .standard.yml configuration file for the example project
  • Integrate standardrb into the example tooling and test suite
  • Add test expectations for Standard Ruby linting violations
  • Update README.md to document Standard Ruby support
  • Pin gem versions in MODULE.bazel and WORKSPACE.bazel for reproducible builds

Implementation Details

  • Follows the established RuboCop linter pattern for consistency
  • Supports both human-readable and machine-readable (JSON/SARIF) output
  • Includes auto-correction/fix functionality
  • Honors exclusion patterns from .standard.yml configuration
  • Proper caching configuration with Bazel integration
  • Uses /tmp for cache directory to avoid workspace pollution
  • Includes --force-exclusion flag to respect exclusion patterns

🤖 Generated with Claude Code

cgrindel and others added 3 commits November 5, 2025 12:09
Add support for Standard Ruby (standardrb) as a Ruby linter alongside RuboCop.
This implementation follows the same pattern as the RuboCop integration with
full support for linting, auto-fixing, and SARIF report generation.

Key changes:
- Add lint/standardrb.bzl with lint_standardrb_aspect for Ruby linting
- Update example configuration with standardrb gem dependency (v1.51.1)
- Add .standard.yml configuration file for the example project
- Integrate standardrb into the example tooling and test suite
- Add test expectations for Standard Ruby linting violations
- Update README.md to document Standard Ruby support
- Pin gem versions in MODULE.bazel and WORKSPACE.bazel for reproducible builds

Standard Ruby is a zero-configuration Ruby linter and formatter based on RuboCop.
It provides stricter defaults and enforces a consistent style guide.

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>
Address code review findings:
- Add --force-exclusion flag in standardrb_action() to honor exclusions
  from .standard.yml even when explicit files are passed
- Add --force-exclusion flag in JSON output action for consistency
- Update Gemfile to use ~> version constraint for standard gem
  to match RuboCop pattern and prevent breaking changes

This ensures Standard Ruby respects exclusion patterns defined in
configuration files, matching the behavior of the RuboCop implementation.

🤖 Generated with Claude Code

Co-Authored-By: Claude <[email protected]>
@aspect-workflows
Copy link

aspect-workflows bot commented Nov 5, 2025

Test

All tests were cache hits

5 tests (100.0%) were fully cached saving 2s.


Test

example

8 test targets passed

Targets
//tools/format:format_test_HTML_Jinja_with_djlint [k8-fastbuild]1s
//tools/format:format_test_JavaScript_with_prettier [k8-fastbuild]7s
//tools/format:format_test_Markdown_with_prettier [k8-fastbuild]2s
//tools/format:format_test_Protocol_Buffer_with_buf [k8-fastbuild]504ms
//tools/format:format_test_Python_with_ruff [k8-fastbuild]352ms
//tools/format:format_test_SQL_with_prettier [k8-fastbuild]966ms
//tools/format:format_test_Scala_with_scalafmt [k8-fastbuild]3s
//tools/format:format_test_Starlark_with_buildifier [k8-fastbuild]199ms

Total test execution time was 15s. 33 tests (80.5%) were fully cached saving 14s.


Test (WORKSPACE) (Test)

example

8 test targets passed

Targets
//tools/format:format_test_HTML_Jinja_with_djlint [k8-fastbuild]1s
//tools/format:format_test_JavaScript_with_prettier [k8-fastbuild]6s
//tools/format:format_test_Markdown_with_prettier [k8-fastbuild]841ms
//tools/format:format_test_Protocol_Buffer_with_buf [k8-fastbuild]794ms
//tools/format:format_test_Python_with_ruff [k8-fastbuild]290ms
//tools/format:format_test_SQL_with_prettier [k8-fastbuild]831ms
//tools/format:format_test_Scala_with_scalafmt [k8-fastbuild]3s
//tools/format:format_test_Starlark_with_buildifier [k8-fastbuild]192ms

Total test execution time was 12s. 13 tests (61.9%) were fully cached saving 8s.


Lint [.]      Lint [example]

cgrindel and others added 2 commits November 5, 2025 12:26
Ensure all lines in lint/standardrb.bzl adhere to the 80 character
limit for Starlark files per project conventions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
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