Skip to content

Commit

Permalink
chore: 新增 pre-commit action
Browse files Browse the repository at this point in the history
  • Loading branch information
l7wei committed Nov 26, 2024
1 parent 4a7feba commit 1f1ac84
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 43 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/formatter.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.1
30 changes: 15 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
exclude: migrations/
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
exclude: migrations/

- repo: https://github.com/psf/black
rev: 24.2.0
hooks:
- id: black
language_version: python3.11
- repo: https://github.com/psf/black
rev: stable
hooks:
- id: black
language_version: python3.11
8 changes: 6 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"python.analysis.typeCheckingMode": "basic",
"python.analysis.autoImportCompletions": true
"editor.defaultFormatter": null,
"editor.formatOnSave": true,
"python.formatting.provider": "black",
"[python]": {
"editor.defaultFormatter": "ms-python.python",
},
}

0 comments on commit 1f1ac84

Please sign in to comment.