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.
When running
loq baseline, violations are determined by comparing files against thedefault_max_linesthreshold (or--threshold), ignoring any pattern-based rules in the config.For example, with this config:
Running
loq baselinewill add explicit rules for any test file over 500 lines, even though thetests/**pattern already allows 1000. This leads to redundant rules like:Expected behavior:
loq baselineshould 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.