Skip to content

baseline should respect pattern-based rules #4

@jlowin

Description

@jlowin

When running loq baseline, violations are determined by comparing files against the default_max_lines threshold (or --threshold), ignoring any pattern-based rules in the config.

For example, with this config:

default_max_lines = 500

[[rules]]
path = "tests/**"
max_lines = 1000

Running loq baseline will add explicit rules for any test file over 500 lines, even though the tests/** pattern already allows 1000. This leads to redundant rules like:

[[rules]]
path = "tests/foo/test_bar.py"
max_lines = 673

Expected behavior: loq baseline should evaluate each file against its effective limit (considering pattern matches), only adding explicit rules for files that exceed their pattern-matched limit.

This would let users set higher limits for certain directories (like tests) without baseline cluttering the config with unnecessary overrides.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions