Skip to content

Commit

Permalink
Merge pull request #3 from kirei/ruff
Browse files Browse the repository at this point in the history
Use ruff
  • Loading branch information
jschlyter authored Sep 2, 2024
2 parents e066845 + 86d0af4 commit 11fb9f5
Show file tree
Hide file tree
Showing 5 changed files with 313 additions and 516 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ name: Tests
on: [push, pull_request]

jobs:
Test:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
test:
runs-on: ubuntu-latest
needs: ruff
strategy:
matrix:
python-version:
Expand All @@ -13,18 +19,19 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Get full python version
id: full-python-version
run: |
echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info[:3]))")
echo version=$(python -c "import sys, platform; print('.'.join(str(v) for v in sys.version_info[:3]) + '_' + platform.machine())") >> $GITHUB_OUTPUT
- name: Set up cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .venv
key: ${{ runner.os }}-venv-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
Expand All @@ -34,13 +41,9 @@ jobs:
poetry config virtualenvs.in-project true
- name: Install dependencies
run: poetry install
- name: Lint
run: |
poetry run pylama wapi2nsconf
- name: Check formatting
- name: Ruff
run: |
poetry run isort --check wapi2nsconf
poetry run black --check wapi2nsconf
poetry run ruff check wapi2nsconf
- name: Check example configuration file
run: |
poetry run wapi2nsconf --check --conf wapi2nsconf-example.yaml
Loading

0 comments on commit 11fb9f5

Please sign in to comment.