Skip to content

Commit

Permalink
feat: Add pre-commit hooks for code quality checks
Browse files Browse the repository at this point in the history
Adding pre-commit hooks to the project for performing code quality checks
using pre-commit framework. This includes hooks for trailing whitespace,
end-of-file fixer, YAML validation, and checking added large files. Also
includes hooks from ruff-pre-commit for linting and formatting.
  • Loading branch information
sudoskys committed Dec 11, 2023
1 parent ff8735f commit f3f6f90
Show file tree
Hide file tree
Showing 4 changed files with 163 additions and 3 deletions.
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
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.7
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
136 changes: 135 additions & 1 deletion pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ testing = [
# FIXME code not compatible with hikari 2.0.0.dev121
"hikari-crescent<1.0.0,>=0.6.4",
"khl-py<1.0.0,>=0.3.17",
"slack-bolt<2.0.0,>=1.18.0"
"slack-bolt<2.0.0,>=1.18.0",
"pre-commit<3.5.0,>=2.15.0",
]

[tool.pdm.dev-dependencies]
Expand All @@ -94,4 +95,3 @@ includes = ["llmkira"]
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"

0 comments on commit f3f6f90

Please sign in to comment.