Retire custom_lint_config? sentinel string-compare in LintWorklistRubocopConfig #238

Closed
opened 2026-08-03 12:42:27 +00:00 by jared · 2 comments
Owner

This was generated by AI during triage.

Problem

LintWorklistRubocopConfig#custom_lint_config? (plugins/os-sdlc/lib/os_sdlc/lint_worklist_rubocop_config.rb:48-50) still checks whether the config it was given equals the default sentinel string ".rubocop.yml" (Project::DEFAULT_LINT_CONFIG):

def custom_lint_config?
  @lint_config && @lint_config != Project::DEFAULT_LINT_CONFIG && @lint_config != target_config_path
end

Since #235 / ADR-0091, that check can never matter in real use. Every production caller now goes through Project#resolved_lint_config, which already translates the sentinel: it returns nil for the default and an absolute path otherwise. Verified call sites:

  • RubocopReportFetcher (rubocop_report_fetcher.rb:12) — passes nothing (nil).
  • AutocorrectPrepass (autocorrect_prepass.rb:81) — passes resolved_lint_config.
  • Lint via the CLI (lint.rb:50, bin/os-sdlc:544) — passes resolved_lint_config.

The only thing keeping the sentinel comparison alive is one unit test that constructs the object directly with the sentinel string: test_missing_default_lint_config_path_does_not_raise_and_uses_plugin_only_chain (tests/lint_worklist_rubocop_config_test.rb:37-39, construction at line 61).

Dead code like this misleads readers into thinking the class still handles the sentinel, when ADR-0091 deliberately moved that responsibility to Project#resolved_lint_config alone.

Solution

  1. Rewrite that test to construct with lint_config: nil (the equivalent post-ADR-0091 input) so it still covers the "no custom config, plugin-only chain" behavior.
  2. Delete the @lint_config != Project::DEFAULT_LINT_CONFIG clause, leaving:
def custom_lint_config?
  @lint_config && @lint_config != target_config_path
end
  1. Run the os-sdlc test suite. No behavior change expected; this also removes the class's last reference to Project::DEFAULT_LINT_CONFIG, decoupling it from Project.

See ADR-0091 for the decision that made this branch dead.

> *This was generated by AI during triage.* ## Problem `LintWorklistRubocopConfig#custom_lint_config?` (`plugins/os-sdlc/lib/os_sdlc/lint_worklist_rubocop_config.rb:48-50`) still checks whether the config it was given equals the default sentinel string `".rubocop.yml"` (`Project::DEFAULT_LINT_CONFIG`): ```ruby def custom_lint_config? @lint_config && @lint_config != Project::DEFAULT_LINT_CONFIG && @lint_config != target_config_path end ``` Since #235 / ADR-0091, that check can never matter in real use. Every production caller now goes through `Project#resolved_lint_config`, which already translates the sentinel: it returns `nil` for the default and an absolute path otherwise. Verified call sites: - `RubocopReportFetcher` (`rubocop_report_fetcher.rb:12`) — passes nothing (nil). - `AutocorrectPrepass` (`autocorrect_prepass.rb:81`) — passes `resolved_lint_config`. - `Lint` via the CLI (`lint.rb:50`, `bin/os-sdlc:544`) — passes `resolved_lint_config`. The only thing keeping the sentinel comparison alive is one unit test that constructs the object directly with the sentinel string: `test_missing_default_lint_config_path_does_not_raise_and_uses_plugin_only_chain` (`tests/lint_worklist_rubocop_config_test.rb:37-39`, construction at line 61). Dead code like this misleads readers into thinking the class still handles the sentinel, when ADR-0091 deliberately moved that responsibility to `Project#resolved_lint_config` alone. ## Solution 1. Rewrite that test to construct with `lint_config: nil` (the equivalent post-ADR-0091 input) so it still covers the "no custom config, plugin-only chain" behavior. 2. Delete the `@lint_config != Project::DEFAULT_LINT_CONFIG` clause, leaving: ```ruby def custom_lint_config? @lint_config && @lint_config != target_config_path end ``` 3. Run the os-sdlc test suite. No behavior change expected; this also removes the class's last reference to `Project::DEFAULT_LINT_CONFIG`, decoupling it from `Project`. See ADR-0091 for the decision that made this branch dead.
Author
Owner

This was generated by AI during triage.

Work started in-session (triage session, 2026-08-03).

> *This was generated by AI during triage.* Work started in-session (triage session, 2026-08-03).
Author
Owner

This was generated by AI during triage.

Fixed and verified. custom_lint_config? no longer compares against Project::DEFAULT_LINT_CONFIG; the test constructs with nil and was renamed accordingly; require_relative "project" dropped (last use). Full os-sdlc suite green: 594 runs, 1571 assertions, 0 failures. Rubocop clean on the lib file; the one test-file offense is pre-existing on an untouched method. Commits 8938d15 (fix) and the status-leaf row. Per ADR-0091.

> *This was generated by AI during triage.* Fixed and verified. custom_lint_config? no longer compares against Project::DEFAULT_LINT_CONFIG; the test constructs with nil and was renamed accordingly; require_relative "project" dropped (last use). Full os-sdlc suite green: 594 runs, 1571 assertions, 0 failures. Rubocop clean on the lib file; the one test-file offense is pre-existing on an untouched method. Commits 8938d15 (fix) and the status-leaf row. Per ADR-0091.
jared closed this issue 2026-08-03 13:09:23 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#238
No description provided.