Skip to content

linter: Add test to verify rule::default matches rule::from_configuration #12720

@camc314

Description

@camc314

Implement a test to ensure consistency between rule::default and rule::from_configuration.

Implementation Details

Add a new test that will:

  1. Iterate through all available linter rules
  2. For each rule:
    • Get the default configuration using rule::default
    • Get the configuration using rule::from_configuration(null)
    • Assert that both configurations produce identical results

This will help prevent issues like #12718 where there might be discrepancies between default configurations and null configurations.

Technical Approach

  1. Create a new test module/function in the appropriate test directory
  2. Implement logic to get all available rules
  3. Create helper function to compare rule configurations
  4. Add assertions to verify equality of configurations
  5. Add documentation explaining the purpose of the test

Success Criteria

  • All rules should be tested
  • Test should fail if any rule's default configuration differs from its null configuration
  • Clear error messages when discrepancies are found

Metadata

Metadata

Assignees

Labels

A-linterArea - LinterC-testCategory - Testing. Code is missing test cases, or a PR is adding them

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions