chore(pre-commit): use google/yamlfmt
All checks were successful
build / build (push) Successful in 1m2s

This commit is contained in:
张泊明518370910136 2024-10-19 06:58:54 -04:00
parent e17fe17fdf
commit e19657c5b0
GPG Key ID: D47306D7062CDA9D
2 changed files with 90 additions and 93 deletions

View File

@ -1,37 +1,35 @@
---
name: build name: build
on: on:
- push - push
- pull_request - pull_request
jobs: jobs:
build: build:
container: container:
image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ubuntu-latest image: focs.ji.sjtu.edu.cn:5000/gitea/runner-images:ubuntu-latest
steps: steps:
- name: Check out repository code - name: Check out repository code
uses: https://gitea.com/BoYanZh/checkout@focs uses: https://gitea.com/BoYanZh/checkout@focs
- name: Display Python3 version - name: Display Python3 version
run: python3 --version run: python3 --version
- name: Install PDM - name: Install PDM
run: | run: |
echo curl echo curl
curl -sSL https://ghp.ci/https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py -o install-pdm.py curl -sSL https://ghp.ci/https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py -o install-pdm.py
echo sed echo sed
sed -i 's|https://github.com|https://ghp.ci/https://github.com|g' install-pdm.py sed -i 's|https://github.com|https://ghp.ci/https://github.com|g' install-pdm.py
echo python3 echo python3
python3 install-pdm.py -p /usr python3 install-pdm.py -p /usr
- name: Display PDM version - name: Display PDM version
run: pdm --version run: pdm --version
- name: PDM install dependencies - name: PDM install dependencies
run: | run: |
pdm install pdm install
- name: Lint - name: Lint
run: | run: |
pdm run lint pdm run lint
- name: Test - name: Test
run: | run: |
pdm run test pdm run test
- name: Run - name: Run
run: | run: |
pdm run app --help pdm run app --help

View File

@ -1,60 +1,59 @@
---
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0 rev: v4.4.0
hooks: hooks:
- id: check-yaml - id: check-yaml
- id: check-toml - id: check-toml
- id: end-of-file-fixer - id: end-of-file-fixer
- id: trailing-whitespace - id: trailing-whitespace
- repo: https://github.com/Lucas-C/pre-commit-hooks - repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5 rev: v1.5.5
hooks: hooks:
- id: remove-crlf - id: remove-crlf
- id: remove-tabs - id: remove-tabs
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt - repo: https://github.com/google/yamlfmt
rev: 0.2.3 rev: v0.13.0
hooks: hooks:
- id: yamlfmt - id: yamlfmt
- repo: https://github.com/pdm-project/pdm - repo: https://github.com/pdm-project/pdm
rev: 2.19.2 rev: 2.19.2
hooks: hooks:
- id: pdm-lock-check - id: pdm-lock-check
- repo: https://github.com/pre-commit/mirrors-mypy - repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.2 rev: v1.11.2
hooks: hooks:
- id: mypy - id: mypy
additional_dependencies: additional_dependencies:
- pydantic - pydantic
- types-PyYAML - types-PyYAML
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v3.17.0 rev: v3.17.0
hooks: hooks:
- id: pyupgrade - id: pyupgrade
- repo: https://github.com/hadialqattan/pycln - repo: https://github.com/hadialqattan/pycln
rev: v2.4.0 rev: v2.4.0
hooks: hooks:
- id: pycln - id: pycln
- repo: https://github.com/PyCQA/bandit - repo: https://github.com/PyCQA/bandit
rev: 1.7.10 rev: 1.7.10
hooks: hooks:
- id: bandit - id: bandit
args: [-c, pyproject.toml] args: [-c, pyproject.toml]
additional_dependencies: ['bandit[toml]'] additional_dependencies: ["bandit[toml]"]
- repo: https://github.com/PyCQA/isort - repo: https://github.com/PyCQA/isort
rev: 5.13.2 rev: 5.13.2
hooks: hooks:
- id: isort - id: isort
args: [--profile, black, --filter-files] args: [--profile, black, --filter-files]
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 24.8.0 rev: 24.8.0
hooks: hooks:
- id: black - id: black
# - repo: local # - repo: local
# hooks: # hooks:
# - id: pytest-check # - id: pytest-check
# name: pytest-check # name: pytest-check
# entry: pdm run test # entry: pdm run test
# language: system # language: system
# pass_filenames: false # pass_filenames: false
# always_run: true # always_run: true