feat(lint): overhaul linting infrastructure#375
Open
Conversation
* Add CI workflow (.github/workflows/ci.yml) to enforce lint on PRs and master * Add rubocop-minitest for Minitest-specific cops * Migrate rubocop extensions from require: to plugins: (new API) * Fix prettier.rake bug: --check and --write were both passed in autocorrect mode * Fix prettier file discovery: pass '.' instead of explicit FileList so .prettierignore is respected * Add .prettierignore to exclude generated/vendor/upstream files * Add FinalNewline linter to .erb-lint.yml * Upgrade prettier 2.2.1 to 2.8.8 (latest v2); add .npmrc for legacy-peer-deps * Add .node-version for CI Node setup
Pattern rules are not discoverable by bin/rails, only by rake, so further pattern rules (e.g.: lint:rubocop:dryrun) must be invoked by rake.
* Lint tasks only shell out to rubocop/prettier/erblint/brakeman and do not need a booted Rails environment * Booting Rails triggered a network call to login.cmu.edu in CI, causing SocketError on GitHub runners * Replace Rails.root.join require with require_relative * Replace ActiveSupport present?/presence with plain Ruby equivalents
* replace prettier@2 + prettier-plugin-erb with prettier@3 + @4az/prettier-plugin-html-erb + @prettier/plugin-ruby@4 * update .prettierrc with explicit plugins array and erb-template parser * remove prettier_print, syntax_tree-haml, syntax_tree-rbs from Gemfile (no longer needed by plugin-ruby v4) * keep syntax_tree gem (plugin-ruby v4 parse server still requires it) * remove inherit_from rubocop.yml from .rubocop.yml (v4 does not ship it)
* add CONTRIBUTING.md with dev container setup, conventional commits guide, branching conventions, and links to linting docs * add docs/linting.md with full linting reference including tools, commands, configuration rationale, and sidebar whitespace gotcha * update README.md to point to CONTRIBUTING.md
* .prettierrc is prettier's native JSON default * drop .prettierignore entry that worked around the YAML parse error * n.b.: sidebar comment moved to docs/linting.md in previous commit
* lint tasks intentionally omit :environment to avoid booting Rails * booting Rails in CI triggers a network call to login.cmu.edu, causing SocketError on GitHub runners
This was referenced Feb 27, 2026
* db/schema.rb is auto-generated; line length violations are not actionable * config/initializers/new_framework_defaults_7_0.rb is a Rails-generated file with intentionally long explanatory comments * shift_picker.rb is a legacy standalone script pending removal
Rails-generated binstubs in bin/ are not project code and should not be linted.
In CI, bundler installs gems into vendor/bundle. RuboCop scans into those directories and encounters a gem's .rubocop.yml that uses inherit_gem: rubocop-discourse, causing MissingSpecError.
Prettier's default for Ruby is double quotes, which conflicts with RuboCop's Style/StringLiterals preference. Setting rubySingleQuote: true aligns both tools so they don't fight each other.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary