Skip to content

Commit bc7bc82

Browse files
committed
csfilter: abstract out other precise numbers in Pylint output
Reported-By: Pavel Raiskup Fixes: https://github.com/kdudka/csdiff/issues/5
1 parent c53ad28 commit bc7bc82

8 files changed

+24365
-2
lines changed

csfilter.cc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,18 @@ struct MsgFilter::Private {
113113
// unify (per build random) names of temporary variables
114114
addMsgFilter("COMPILER_WARNING", "_tmp[0-9]+_", "_tmp_");
115115

116-
// pylint: "Too many lines in module (1152/1000)" etc.
117-
addMsgFilter("PROSPECTOR_WARNING", " \\([0-9]+/[0-9]+\\)$", "");
116+
// pylint reports, either raw, or prospector-wrapped
117+
const std::vector<std::string> pylintCheckers= {
118+
"PROSPECTOR_WARNING",
119+
"PYLINT_WARNING"
120+
};
121+
BOOST_FOREACH(const std::string &checker, pylintCheckers) {
122+
// "Too many lines in module (1152/1000)" etc.
123+
addMsgFilter(checker, " \\([0-9]+/[0-9]+\\)$", "");
124+
125+
// "... Redefining name 'desc' from outer scope (line 10)" etc.
126+
addMsgFilter(checker, " \\(line [0-9]+\\)$", "");
127+
}
118128

119129
// "__coverity_strcmp" -> "strcmp", etc.
120130
addMsgFilter("", "__coverity_", "");

tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ test_csdiff(diff-misc 07)
209209
test_csdiff(diff-misc 08)
210210
test_csdiff(diff-misc 09-shellcheck-raw)
211211
test_csdiff(diff-misc 10-pylint-copr)
212+
test_csdiff(diff-misc 11-pylint-copr-json)
212213

213214
# cstrans-df-run tests
214215
tests_cstrans_df_run(0001)

tests/diff-misc/11-pylint-copr-json-add-z.err

Whitespace-only changes.

tests/diff-misc/11-pylint-copr-json-add.err

Whitespace-only changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Error: PYLINT_WARNING:
2+
coprs_frontend/commands/rawhide_to_release.py:8: W0611(unused-import): Unused builds_logic imported from coprs.logic
3+
4+
Error: PYLINT_WARNING:
5+
coprs_frontend/coprs/logic/complex_logic.py:325: C0301(line-too-long): Line too long (139/120)
6+
7+
Error: PYLINT_WARNING:
8+
coprs_frontend/coprs/models.py:294: C0330(bad-continuation): Wrong continued indentation (add 12 spaces).
9+
nullable=False, primary_key=True)
10+
^ |
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Error: PYLINT_WARNING:
2+
coprs_frontend/commands/rawhide_to_release.py:8: W0611(unused-import): Unused builds_logic imported from coprs.logic
3+
4+
Error: PYLINT_WARNING:
5+
coprs_frontend/coprs/logic/complex_logic.py:325: C0301(line-too-long): Line too long (139/120)
6+
7+
Error: PYLINT_WARNING:
8+
coprs_frontend/coprs/models.py:294: C0330(bad-continuation): Wrong continued indentation (add 12 spaces).
9+
nullable=False, primary_key=True)
10+
^ |

0 commit comments

Comments
 (0)