Updated versions of linters and other dependencies #1815
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python build | |
on: [ push, pull_request ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
# Consistent with base image in Dockerfile | |
# container: stepik/hyperstyle-base:py3.8.11-java11.0.11-node14.17.3-go1.18.5 | |
container: nastyabirillo/hyperstyle:1.4.4 | |
steps: | |
- name: Install git | |
run: | | |
apt-get update | |
apt-get -y install git | |
- name: Check env variables | |
run: | | |
echo $DETEKT_DIRECTORY && echo $DETEKT_VERSION | |
echo $CHECKSTYLE_DIRECTORY && echo CHECKSTYLE_VERSION | |
echo $PMD_DIRECTORY && echo PMD_VERSION | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install requirements | |
run: | | |
pip install --no-cache-dir -r requirements-test.txt -r requirements.txt | |
- name: Set up git rights | |
run: | | |
git config --global --add safe.directory '*' | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=.git,__pycache__,docs/source/conf.py,old,build,dist,venv,test/resources,.eggs,review.egg-info,.pytest_cache,node_modules | |
# TODO: change max-complexity into 10 after refactoring | |
# 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,WPS,H601,N400 --statistics --exclude=.git,__pycache__,docs/source/conf.py,old,build,dist,venv,test/resources,.eggs,review.egg-info,.pytest_cache,node_modules | |
- name: Sort whitelists | |
run: | | |
for file in "whitelist.txt" "hyperstyle/src/python/review/inspectors/flake8/whitelist.txt" | |
do | |
LC_ALL=C sort $file -o $file | |
done | |
- name: Commit sorted whitelists | |
uses: EndBug/[email protected] | |
with: | |
add: "['whitelist.txt', 'hyperstyle/src/python/review/inspectors/flake8/whitelist.txt']" | |
message: 'Sort whitelists (Github Actions)' | |
- name: Set up Eslint | |
run: | | |
# Consistent with eslint version in Dockerfile | |
npm install [email protected] -g && eslint --init | |
- name: Test with pytest | |
run: | | |
pytest -vv | |
- name: Install review module | |
run: | | |
pip install . | |
- name: Check installed module can run python linters | |
run: | | |
review setup.py | |
- name: Check installed module can run java linters | |
run: | | |
review test/resources/inspectors/java/test_algorithm_with_scanner.java | |
- name: Check installed module can run js linters | |
run: | | |
review test/resources/inspectors/js/case0_no_issues.js |