Skip to content

Commit 92298bd

Browse files
authored
fix setting of lines-changed-only (#90)
The README states that the value of true focuses on lines in diff with additions only. Setting it to 'diff' will use the original behavior (meaning entire diff chunks with unchanged lines). However, I forgot to change this value's interpretation in the src code (& test). This commit makes the README accurate.
1 parent df06936 commit 92298bd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cpp_linter/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
"-l",
123123
"--lines-changed-only",
124124
default=0,
125-
type=lambda a: 1 if a.lower() == "true" else (2 if a.lower() == "strict" else 0),
125+
type=lambda a: 2 if a.lower() == "true" else (1 if a.lower() == "diff" else 0),
126126
help="Set this option to 'true' to only analyze changes in the event's diff. "
127127
"Set this to 'strict' to only analyze additions in the event's diff. "
128128
"Defaults to %(default)s.",

tests/test_cli_args.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def test_defaults():
5757
("extensions", "cxx,.hpp", "extensions", ["cxx", "hpp"]),
5858
("repo-root", "src", "repo_root", "src"),
5959
("ignore", "!src|", "ignore", "!src|"),
60-
("lines-changed-only", "True", "lines_changed_only", 1),
61-
("lines-changed-only", "stricT", "lines_changed_only", 2),
60+
("lines-changed-only", "True", "lines_changed_only", 2),
61+
("lines-changed-only", "Diff", "lines_changed_only", 1),
6262
("files-changed-only", "True", "files_changed_only", True),
6363
("thread-comments", "True", "thread_comments", True),
6464
("file-annotations", "False", "file_annotations", False),

0 commit comments

Comments
 (0)