Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ jobs:
# TODO: remove R504, A003, E800, E402, WPS1, WPS2, WPS3, WPS4, WPS5, WPS6, H601
flake8 . --count --max-complexity=11 --max-line-length=120 --max-doc-length=120 --ignore=R504,A003,E800,E402,W503,WPS1,WPS2,WPS3,WPS4,WPS5,WPS6,H601 --statistics --exclude=.git,__pycache__,docs/source/conf.py,old,build,dist,venv,test/resources,.eggs,review.egg-info,.pytest_cache,node_modules

- name: Check whitelists are sorted
run: |
for file in "whitelist.txt" "src/python/review/inspectors/flake8/whitelist.txt"
do
if ! sort -c $file
then
echo "$file is not sorted"
exit 1
fi
done

- name: Set up Eslint
run: |
# Consistent with eslint version in Dockerfile
Expand All @@ -44,4 +55,4 @@ jobs:

- name: Check installed module can run js linters
run: |
python src/python/review/run_tool.py test/resources/inspectors/js/case0_no_issues.js
python src/python/review/run_tool.py test/resources/inspectors/js/case0_no_issues.js
7 changes: 6 additions & 1 deletion src/python/review/inspectors/pmd/files/bin/basic.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,12 @@
<rule ref="category/java/errorprone.xml/AvoidFieldNameMatchingMethodName"/>
<rule ref="category/java/errorprone.xml/AvoidFieldNameMatchingTypeName"/>
<rule ref="category/java/errorprone.xml/AvoidInstanceofChecksInCatchClause"/>
<rule ref="category/java/errorprone.xml/AvoidLiteralsInIfCondition"/>
<rule ref="category/java/errorprone.xml/AvoidLiteralsInIfCondition"
message="Avoid using magic numbers in Conditional Statements. It is better to use constants.">
<properties>
<property name="ignoreMagicNumbers" value="-1,0,1"/>
</properties>
</rule>
<rule ref="category/java/errorprone.xml/AvoidLosingExceptionInformation"/>
<rule ref="category/java/errorprone.xml/AvoidMultipleUnaryOperators"/>
<rule ref="category/java/errorprone.xml/AvoidUsingOctalValues"/>
Expand Down
4 changes: 2 additions & 2 deletions test/python/inspectors/test_pmd_inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_output_parsing(file_name: str, expected_issues: List[CodeIssue]):
FILE_NAMES_AND_N_ISSUES = [
('test_algorithm_with_scanner.java', 0),
('test_simple_valid_program.java', 0),
('test_boolean_expr.java', 2),
('test_boolean_expr.java', 1),
('test_class_with_booleans.java', 3),
('test_closing_streams.java', 1),
('test_code_with_comments.java', 0),
Expand All @@ -105,7 +105,7 @@ def test_output_parsing(file_name: str, expected_issues: List[CodeIssue]):
('test_thread_run.java', 1),
('test_unused_imports.java', 4),
('test_valid_algorithm_1.java', 0),
('test_valid_curly_braces.java', 1),
('test_valid_curly_braces.java', 0),
('test_when_only_equals_overridden.java', 1),
('test_valid_spaces.java', 0),
]
Expand Down
Loading