You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Increment version to 1.0.18, update README to clarify exit code behavior and analysis limits, enhance documentation on severity filtering, and improve performance detection for async loops. Refactor detector methods for better clarity and add tests for new functionality and suppression behavior.
-`-c, --config`: Configuration file path; when omitted, auto-discover `pyproject.toml` (`[tool.pyrefactor]`), then `pyrefactor.ini`, then built-in defaults
80
80
-`-g, --group-by`: Group by `file` or `severity` (default: `file`)
-`--min-severity`: Minimum severity to report: `info`, `low`, `medium`, `high` (default: `info`). Also filters which issues count toward the exit code.
82
82
-`-j, --jobs`: Number of parallel workers (default: 4)
83
83
-`-v, --verbose`: Enable verbose logging
84
84
-`--fail-on-parse-errors`: Exit with code 1 when any file has a syntax or parse error
85
85
-`--version`: Show version
86
86
87
87
### Exit Codes
88
88
89
-
-`0` - No MEDIUM/HIGH severity issues (INFO/LOW only). Per-file syntax or parse errors are reported in output but do not change the exit code unless `--fail-on-parse-errors` is set.
90
-
-`1` - MEDIUM/HIGH severity issues found, or parse errors when `--fail-on-parse-errors` is used
89
+
Exit codes are computed **after** applying `--min-severity`. For example, `--min-severity high` can exit `0` even when MEDIUM issues exist, because those issues are filtered out before the exit code is determined.
90
+
91
+
-`0` - No MEDIUM/HIGH severity issues remain after filtering (INFO/LOW only). Per-file syntax or parse errors are reported in output but do not change the exit code unless `--fail-on-parse-errors` is set.
92
+
-`1` - MEDIUM/HIGH severity issues remain after filtering, or parse errors when `--fail-on-parse-errors` is used
91
93
-`2` - Configuration, path, or orchestration error (invalid paths, missing config, no Python files to analyze)
92
94
95
+
### Analysis Limits
96
+
97
+
Files larger than **10 MB** are skipped with a parse-style error message. This limit is fixed and not configurable.
Copy file name to clipboardExpand all lines: docs/CONFIGURATION.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,6 +124,12 @@ The CLI does not override individual detector thresholds. Use `--config` to poin
124
124
125
125
Use `--fail-on-parse-errors` when integrating PyRefactor into CI: by default, syntax and parse errors are reported but do not affect the exit code; with this flag, any parse error causes exit code `1`.
126
126
127
+
`--min-severity` filters both console output and exit-code calculation. Issues below the minimum severity are omitted entirely.
128
+
129
+
## Analysis Limits
130
+
131
+
Files larger than **10 MB** are skipped with a parse-style error message. This limit is fixed in the implementation and is not configurable.
132
+
127
133
## Related Documentation
128
134
129
135
-[RULES.md](RULES.md) — rule IDs, severities, and examples
| L003 | MEDIUM | Deeply nested loops with membership or subscript lookups |
50
50
| L004 | MEDIUM | Loop-invariant expensive call inside loop body |
51
51
@@ -81,8 +81,8 @@ Covers `open`, `urlopen`, `ZipFile`, `Popen`, `Path.open()`, and related APIs.
81
81
| Rule | Severity | Description |
82
82
|------|----------|-------------|
83
83
| R006 | LOW |`if key in d: x = d[key] else: x = default` should use `.get()`|
84
-
| R007 |LOW| Consider `.items()` when iterating keys and accessing values |
85
-
| R009 |LOW| Unnecessary `.keys()` in a membership test |
84
+
| R007 |MEDIUM| Consider `.items()` when iterating keys and accessing values |
85
+
| R009 |INFO| Unnecessary `.keys()` in a membership test |
86
86
| R010 | LOW |`dict([...])` should be a dict comprehension |
87
87
88
88
R008 is reserved and not currently implemented.
@@ -114,8 +114,14 @@ y = 2
114
114
115
115
## Exit Codes
116
116
117
+
Exit codes are computed **after** applying `--min-severity`. Issues below the minimum severity are omitted from output and do not affect the exit code.
118
+
117
119
| Code | Meaning |
118
120
|------|---------|
119
-
| 0 | No MEDIUM/HIGH issues (after severity filter). Per-file syntax/parse errors are reported but exit 0. |
120
-
| 1 | One or more MEDIUM/HIGH issues found|
121
+
| 0 | No MEDIUM/HIGH issues remain after the severity filter. Per-file syntax/parse errors are reported but exit 0 unless `--fail-on-parse-errors` is set. |
122
+
| 1 | One or more MEDIUM/HIGH issues remain after the severity filter, or any parse error when `--fail-on-parse-errors` is set|
121
123
| 2 | Configuration, path, or orchestration error (invalid paths, no Python files to analyze) |
124
+
125
+
## Analysis Limits
126
+
127
+
Files larger than **10 MB** are skipped with a parse-style error message. This limit is fixed in the implementation and is not configurable.
description = "A Python refactoring and optimization linter that analyzes code for performance issues, complexity problems, and opportunities for improvement"
0 commit comments