Skip to content

Commit

Permalink
ci: sync with template repository
Browse files Browse the repository at this point in the history
  • Loading branch information
liblaf committed Dec 1, 2023
1 parent 00d12bd commit 8e37db2
Show file tree
Hide file tree
Showing 15 changed files with 311 additions and 438 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ jobs:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check
run: |-
run: |
function checks() {
(gh pr checks ${{ github.event.pull_request.number }} || true) |
(gh pr checks ${{ github.event.pull_request.html_url }} || true) |
grep --invert-match ${{ github.run_id }}
}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
pull_request:

permissions:
contents: write
pull-requests: write

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:
contents: write

concurrency:
group: ${{ github.workflow }}
group: ${{ github.workflow }}-${{ github.ref }}

jobs:
template:
Expand Down
129 changes: 46 additions & 83 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,39 @@
ci:
autofix_commit_msg: |-
autofix_commit_msg: |
ci(pre-commit): auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autoupdate_commit_msg: |-
autoupdate_commit_msg: |
ci(pre-commit): pre-commit autoupdate
skip:
- cargo-check
- clippy
- fmt
- go-build-mod
- go-build-repo-mod
- go-mod-tidy
- go-mod-tidy-repo
- go-test-mod
- go-test-repo-mod
- go-vet-mod
- go-vet-repo-mod
- latexindent
- cargo-clippy
- poetry-lock

repos:
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
hooks:
- id: cmake-format
- id: cmake-lint
- id: ruff
args:
- --fix
- id: ruff-format
- repo: https://github.com/cmhughes/latexindent.pl
rev: V3.23.3
hooks:
- id: latexindent-conda
- repo: https://github.com/commitizen-tools/commitizen
rev: 3.12.0
hooks:
- id: commitizen
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: cargo-check
- id: clippy
- id: fmt
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.5
rev: v17.0.6
hooks:
- id: clang-format
types_or:
- c
- c++
- cuda
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
Expand All @@ -56,6 +47,7 @@ repos:
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
Expand All @@ -64,8 +56,6 @@ repos:
- id: check-vcs-permalinks
- id: check-xml
- id: check-yaml
args:
- --unsafe
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
Expand All @@ -74,86 +64,59 @@ repos:
- id: mixed-line-ending
- id: name-tests-test
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
- id: black-jupyter
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args:
- --profile=black
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.27.1
rev: 0.27.2
hooks:
- id: check-azure-pipelines
- id: check-bamboo-spec
- id: check-buildkite
- id: check-dependabot
- id: check-github-actions
- id: check-github-workflows
- id: check-gitlab-ci
- id: check-readthedocs
- id: check-renovate
- id: check-travis
- repo: https://github.com/python-poetry/poetry
rev: 1.7.0
hooks:
- id: poetry-check
- id: poetry-lock
- id: poetry-export
args:
- --output=requirements.txt
- --without-hashes
- --without-urls
- id: poetry-lock
files: pyproject.toml
- id: poetry-install
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.7.0-3
rev: v3.7.0-4
hooks:
- id: shfmt-src
files: (\.sh|\.zsh|\.zsh-theme|envrc|zshrc)(\.tmpl)?$
- id: shfmt
files: \.(bash|sh|zsh)(\.tmpl)?$
types:
- text
args:
- --write
- --simplify
- --indent=2
- --case-indent
- repo: https://github.com/sirosen/texthooks
rev: 0.6.2
- --space-redirects
- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.0.0
hooks:
- id: fix-ligatures
- id: fix-smartquotes
- id: fix-spaces
- id: forbid-bidi-controls
- id: macro-expand
- repo: https://github.com/TekWizely/pre-commit-golang
rev: v1.0.0-rc.1
hooks:
- id: go-build-mod
- id: go-build-repo-mod
- id: go-fmt
- id: go-fmt-repo
- id: go-mod-tidy
- id: go-mod-tidy-repo
- id: go-test-mod
- id: go-test-repo-mod
- id: go-vet-mod
- id: go-vet-repo-mod
- id: cspell
- repo: local
hooks:
- id: latexindent
name: Pretty LaTeX
entry: latexindent
language: system
files: .(tex|sty|cls|bib)$
- id: cargo-check
name: cargo check
entry: cargo check
language: rust
types:
- text
args:
- --overwriteIfDifferent
- --silent
- --cruft=/tmp
- --modifylinebreaks
- --GCString
- rust
pass_filenames: false
- id: cargo-clippy
name: cargo clippy
entry: cargo clippy
language: rust
types:
- rust
pass_filenames: false
- id: cargo-fmt
name: cargo fmt
entry: cargo fmt
language: rust
types:
- rust
pass_filenames: false
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ DIST := dist

SYSTEM != python -c 'import platform; print(platform.system().lower())'
MACHINE != python -c 'import platform; print(platform.machine().lower())'

ifeq ($(SYSTEM), windows)
EXE := .exe
else
EXE :=
endif
EXE := $(if $(filter windows,$(SYSTEM)),.exe)

DIST_TARGET := $(DIST)/$(NAME)-$(SYSTEM)-$(MACHINE)$(EXE)

Expand All @@ -23,7 +18,7 @@ clean:
@ $(RM) --recursive --verbose $(DIST)
@ $(RM) --verbose out.gif
@ find . -type d -name '__pycache__' -exec $(RM) --recursive --verbose '{}' +
@ find . -type f -name '*.spec' -exec $(RM) --verbose '{}' +
@ find . -type f -name '*.spec' -delete

demo: $(ASSETS)/demo.png

Expand Down
60 changes: 60 additions & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
words:
- choco
- coassb
- cython
- dmypy
- gomod
- ipynb
- jzsj
- kczy
- kjflb
- kjflid
- kjxxb
- kssj
- liblaf
- mdurl
- mkdocs
- nointeraction
- nuitka
- pybuilder
- pycache
- pydantic
- pyflow
- pyinstaller
- pynr
- pypa
- pypackages
- pysj
- pytype
- queryxnxq
- scsj
- sfgk
- thauth
- tqdm
- typer
- wjdx
- wjid
- wjlx
- wlkc
- wlkcid
- wlxt
- xktjb
- xszyid
- yjwg
- ywkcm
- zyid
- zywkcm
ignorePaths:
- "*-lock.*"
- "*.lock"
dictionaries:
- bash
- cpp
- cpp-refined
- dotnet
- golang
- makefile
- npm
- python
- python-common
allowCompoundWords: true
Loading

0 comments on commit 8e37db2

Please sign in to comment.