Skip to content

Commit

Permalink
Added versions to the ruff and black linter actions (#90)
Browse files Browse the repository at this point in the history
Closes #89 

Added versions to the linter actions. Since the pyproject.toml specifies
distinct versions for each (instead of say ^24.1.0), I put the version
equal to what is in the toml. Note that, as in the other stories
referenced, the black linter supports the concept of capability
versions. We're just not using itwith:
          version: 0.0.278here.
  • Loading branch information
jcadam14 authored Feb 2, 2024
1 parent 45bb608 commit bb54431
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,34 @@ jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
options: "--check --diff --verbose"
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config virtualenvs.create false
poetry install --only linters
- name: Run black
run: |
poetry run black --check .
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry config virtualenvs.create false
poetry install --only linters
- name: Run ruff
run: |
poetry run ruff .
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ pandera = "^0.18.0"
[tool.poetry.group.dev.dependencies]
pytest = "8.0.0"
pytest-cov = "4.1.0"
black = "24.1.1"
ruff = "0.1.15"

[tool.poetry.group.data.dependencies]
openpyxl = "^3.1.2"
Expand All @@ -27,6 +25,11 @@ openpyxl = "^3.1.2"
tabulate = "^0.9.0"
typer = "^0.9.0"


[tool.poetry.group.linters.dependencies]
black = "24.1.1"
ruff = "0.1.15"

[tool.poetry.scripts]
cfpb-val = 'regtech_data_validator.cli:app'

Expand Down

0 comments on commit bb54431

Please sign in to comment.