Skip to content

Commit

Permalink
chore: Improve code style checks
Browse files Browse the repository at this point in the history
  • Loading branch information
MarekSuchanek committed Sep 16, 2024
1 parent 3a95f24 commit f304397
Show file tree
Hide file tree
Showing 55 changed files with 1,790 additions and 1,043 deletions.
75 changes: 67 additions & 8 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
cache: pip
cache-dependency-path: |
**/pyproject.toml
Expand All @@ -26,10 +26,10 @@ jobs:
run: |
bash scripts/build-info.sh
- name: Install Flake8 (5.0.4)
- name: Install Flake8 (7.1.0)
run: |
python -m pip install --upgrade pip
pip install flake8==5.0.4
pip install flake8==7.1.0
- name: Install dependencies
run: |
Expand All @@ -51,6 +51,7 @@ jobs:
echo "- $package"
echo "-------------------------------------------------"
pip install packages/$package
rm -rf packages/$package/build
echo "================================================="
done
Expand All @@ -71,7 +72,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12
cache: pip
cache-dependency-path: |
**/pyproject.toml
Expand All @@ -81,10 +82,10 @@ jobs:
run: |
bash scripts/build-info.sh
- name: Install MyPy (1.4.1)
- name: Install MyPy (1.11.2)
run: |
python -m pip install --upgrade pip
pip install mypy==1.4.1
pip install mypy==1.11.2
- name: Install dependencies
run: |
Expand All @@ -106,14 +107,17 @@ jobs:
echo "- $package"
echo "-------------------------------------------------"
pip install packages/$package
rm -rf packages/$package/build
echo "================================================="
done
- name: Check typing with MyPy
run: |
mypy --install-types --ignore-missing-imports --check-untyped-defs --non-interactive packages/*/dsw
mypy --install-types --ignore-missing-imports \
--check-untyped-defs --non-interactive \
packages/*/dsw
# Consistency of version tagging
version:
name: Version consts.py
runs-on: ubuntu-latest
Expand Down Expand Up @@ -145,3 +149,58 @@ jobs:
bash scripts/check-version.sh \
packages/dsw-tdk/dsw/tdk/consts.py \
packages/dsw-tdk/pyproject.toml
# Pylint
pylint:
name: Pylint
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip
cache-dependency-path: |
**/pyproject.toml
**/requirements*.txt
- name: Create build info
run: |
bash scripts/build-info.sh
- name: Install PyLint (3.2.5)
run: |
python -m pip install --upgrade pip
pip install pylint==3.2.5
- name: Install dependencies
run: |
ROOT=$(pwd)
for package in $(ls packages); do
echo "-------------------------------------------------"
echo "- $package"
echo "-------------------------------------------------"
cd "$ROOT/packages/$package"
pip install -r requirements.txt
make local-deps
echo "================================================="
done
- name: Install packages
run: |
for package in $(ls packages); do
echo "-------------------------------------------------"
echo "- $package"
echo "-------------------------------------------------"
pip install packages/$package
rm -rf packages/$package/build
echo "================================================="
done
- name: Lint with PyLint
run: |
pylint --rcfile=.pylintrc.ini packages/*/dsw
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
- 'ubuntu-latest'
- 'windows-latest'
python-version:
- '3.10'
- '3.11'
- '3.12'

runs-on: ${{ matrix.os }}

Expand Down
Loading

0 comments on commit f304397

Please sign in to comment.