Skip to content

Commit

Permalink
bring black back
Browse files Browse the repository at this point in the history
  • Loading branch information
sainak committed Sep 1, 2023
1 parent 253bcf4 commit f3ba502
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
echo "changed_files=$(git diff --name-only --diff-filter=ACMR ${{ github.event.before }} ${{ github.event.after }} | grep -E '\.py$|\/pyproject.toml$' | xargs)" >> $GITHUB_OUTPUT
fi
- uses: psf/black@stable

- uses: chartboost/ruff-action@v1
if: steps.changed-files.outputs.changed_files != ''
with:
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ repos:
- id: check-yaml
- id: check-toml

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
args: ["--config=pyproject.toml"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.285
hooks:
Expand Down
2 changes: 2 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"recommendations": [
"boto3typed.boto3-ide",
"ms-python.python",
"ms-python.vscode-pylance",
"charliermarsh.ruff"
]
}
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"editor.formatOnSave": false
},
"[python]": {
"editor.defaultFormatter": null,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true
}
Expand All @@ -20,4 +20,6 @@
"files.trimTrailingWhitespace": true,
"githubPullRequests.ignoredPullRequestBranches": ["master"],
"python.languageServer": "Pylance",
"python.formatting.blackPath": "${workspaceFolder}/.venv/bin/black",
"python.formatting.provider": "black",
}
1 change: 1 addition & 0 deletions requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ django-silk==5.0.3 # https://github.com/jazzband/django-silk/blob/master/CHANGE

# Code quality
# ------------------------------------------------------------------------------
black==23.3.0 # https://github.com/psf/black/blob/main/CHANGES.md
ruff==0.0.285 # https://github.com/astral-sh/ruff/releases
pre-commit==3.3.2 # https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md

Expand Down

0 comments on commit f3ba502

Please sign in to comment.