Skip to content

Add a new optional argument (#179) #1744

Add a new optional argument (#179)

Add a new optional argument (#179) #1744

Workflow file for this run

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.3
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/add-and-commit@v7.2.1
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 eslint@7.5.0 -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