Skip to content

Commit

Permalink
Merge pull request #845 from CodeForPhilly/lebovits/issu841-switch-to…
Browse files Browse the repository at this point in the history
…-ruff

Lebovits/issu841 switch to ruff
  • Loading branch information
nlebovits authored Jul 29, 2024
2 parents 9c69a51 + 822535e commit 542d159
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pr_checks_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- 'Dockerfile-pg'
- 'init_pg.sql'
- 'docker-compose.yml'
workflow_dispatch:

jobs:
build:
Expand All @@ -29,17 +30,16 @@ jobs:
with:
python-version: '3.11.4'

- name: Run Black Formatter in Docker
- name: Run Ruff Formatter in Docker
run: |
cd data
docker-compose run --rm formatter
continue-on-error: true

- name: Run Flake8
- name: Run Ruff Linter in Docker
run: |
cd data
pip install flake8
flake8 .
docker-compose run --rm linter
continue-on-error: true

- name: Build vacant-lots-proj
Expand Down
14 changes: 7 additions & 7 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"${workspaceFolder}/data/src",
"${workspaceFolder}/data/src/awkde"
],
"python.testing.pytestEnabled": true,
"python.testing.cwd": "${workspaceFolder}/data/src",
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "ms-python.black-formatter"
"editor.defaultFormatter": "charliermarsh.ruff"
},
"python.formatting.provider": "black",
"python.linting.flake8Enabled": true,
"python.linting.enabled": true,
"python.linting.flake8Args": ["--max-line-length=88"]
"notebook.formatOnSave.enabled": true,
"notebook.codeActionsOnSave": {
"notebook.source.fixAll": "explicit",
"notebook.source.organizeImports": "explicit"
}
}
10 changes: 9 additions & 1 deletion data/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ services:
context: .
volumes:
- ./src:/usr/src/app
command: sh -c "pipenv run black /usr/src/app"
command: sh -c "pip install ruff && ruff /usr/src/app --fix || exit 0"
network_mode: 'host'

linter:
build:
context: .
volumes:
- ./src:/usr/src/app
command: sh -c "pip install ruff && ruff check /usr/src/app || exit 0"
network_mode: 'host'

streetview:
Expand Down

0 comments on commit 542d159

Please sign in to comment.