Skip to content

Commit 57ff037

Browse files
committed
add icdiff prefix to cli options
1 parent 2eeff77 commit 57ff037

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

pytest_icdiff.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,42 @@
1616

1717
def pytest_addoption(parser):
1818
parser.addoption(
19-
"--cols",
19+
"--icdiff-cols",
2020
action="store",
2121
default=None,
2222
help="pytest-icdiff: specify the width of the screen, in case autodetection fails you",
2323
)
2424
parser.addoption(
25-
"--show-all-spaces",
25+
"--icdiff-show-all-spaces",
2626
default=False,
2727
action="store_true",
2828
help="pytest-icdiff: color all non-matching whitespace including that which is not needed for drawing the eye to changes. Slow, ugly, displays all changes",
2929
)
3030
parser.addoption(
31-
"--highlight",
31+
"--icdiff-highlight",
3232
default=False,
3333
action="store_true",
3434
help="pytest-icdiff: color by changing the background color instead of the foreground color. Very fast, ugly, displays all changes",
3535
)
3636
parser.addoption(
37-
"--line-numbers",
37+
"--icdiff-line-numbers",
3838
default=False,
3939
action="store_true",
4040
help="pytest-icdiff: generate output with line numbers. Not compatible with the 'exclude-lines' option.",
4141
)
4242
parser.addoption(
43-
"--tabsize",
43+
"--icdiff-tabsize",
4444
default=2,
4545
help="pytest-icdiff: tab stop spacing",
4646
)
4747
parser.addoption(
48-
"--truncate",
48+
"--icdiff-truncate",
4949
default=False,
5050
action="store_true",
5151
help="pytest-icdiff: truncate long lines instead of wrapping them",
5252
)
5353
parser.addoption(
54-
"--strip-trailing-cr",
54+
"--icdiff-strip-trailing-cr",
5555
default=False,
5656
action="store_true",
5757
help="pytest-icdiff: strip any trailing carriage return at the end of an input line",
@@ -72,9 +72,9 @@ def pytest_assertrepr_compare(config, op, left, right):
7272
# Bail out of generating a diff and use pytest default output
7373
return
7474

75-
COLS = int(config.getoption("--cols") or AUTO_COLS)
75+
COLS = int(config.getoption("--icdiff-cols") or AUTO_COLS)
7676
half_cols = COLS / 2 - MARGINS
77-
TABSIZE = int(config.getoption("--tabsize") or 2)
77+
TABSIZE = int(config.getoption("--icdiff-tabsize") or 2)
7878

7979
pretty_left = pformat(left, indent=TABSIZE, width=half_cols).splitlines()
8080
pretty_right = pformat(right, indent=TABSIZE, width=half_cols).splitlines()
@@ -92,12 +92,12 @@ def pytest_assertrepr_compare(config, op, left, right):
9292

9393
differ = icdiff.ConsoleDiff(
9494
cols=diff_cols,
95-
show_all_spaces=config.getoption("--show-all-spaces"),
96-
highlight=config.getoption("--highlight"),
97-
line_numbers=config.getoption("--line-numbers"),
95+
show_all_spaces=config.getoption("--icdiff-show-all-spaces"),
96+
highlight=config.getoption("--icdiff-highlight"),
97+
line_numbers=config.getoption("--icdiff-line-numbers"),
9898
tabsize=TABSIZE,
99-
truncate=config.getoption("--truncate"),
100-
strip_trailing_cr=config.getoption("--strip-trailing-cr"),
99+
truncate=config.getoption("--icdiff-truncate"),
100+
strip_trailing_cr=config.getoption("--icdiff-strip-trailing-cr"),
101101
)
102102

103103
if not config.get_terminal_writer().hasmarkup:

0 commit comments

Comments
 (0)