Skip to content

Commit

Permalink
add ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
Carbon225 committed Dec 1, 2023
1 parent 0f93e5b commit 5fc961e
Show file tree
Hide file tree
Showing 8 changed files with 833 additions and 441 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,26 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
ref: ${{ github.event.pull_request.head.ref }}

- name: Install poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov pytest-mock coverage-badge
pip install .
- 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
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
run: poetry install

- name: Test with pytest
run: |
pytest -vv --cov-report term-missing --cov=ens_normalize tests/
run: poetry run pytest -vv --cov-report term-missing --cov=ens_normalize tests/

- name: Coverage
run: coverage-badge -f -o coverage_badge.svg
run: poetry run coverage-badge -f -o coverage_badge.svg

- name: Commit changess
uses: EndBug/add-and-commit@v9
with:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Ruff
on: [push, pull_request]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: chartboost/ruff-action@v1
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
Loading

0 comments on commit 5fc961e

Please sign in to comment.