Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/pre_commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test and Merge

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.10"

# Install and run pre-commit
- run: |
pip install pre-commit
pre-commit install
pre-commit run --all-files
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
**/.idea/
**/__pycache__/*
**/_build
/Doc/api/
/Doc/doxygen/
/node_modules/
44 changes: 44 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v6.0.0"
hooks:
- id: check-added-large-files
args: ["--maxkb=1024"]
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
exclude: ^\.clang-format$ # check-yaml do not support multi-document file
- id: debug-statements
exclude: "Base/QTGUI/Testing/Data/Input/qSlicerScriptedLoadableModuleSyntaxErrorTestWidget.py|Base/QTGUI/Testing/Data/Input/qSlicerScriptedLoadableModuleSyntaxErrorTest.py"
- id: end-of-file-fixer
exclude: "\\.(md5|svg|vtk|vtp)$|^Resources\\/[^\\/]+\\.h$|\\/ColorFiles\\/.+\\.txt$|Data\\/Input\\/.+$"
- id: mixed-line-ending
exclude: "\\.(svg|vtk|vtp)$"
- id: trailing-whitespace
exclude: "\\.(svg|vtk|vtp)$"

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.7
hooks:
- id: ruff-check
args: ["--fix", "--show-fixes"]

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: "v21.1.6"
hooks:
- id: clang-format
types_or: [file, text]
files: \.(cpp|cxx|h|hpp|hxx|txx)$

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
types_or: [yaml]

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: "0.35.0"
hooks:
- id: check-dependabot
- id: check-github-workflows
18 changes: 18 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2

build:
os: ubuntu-24.04
tools:
python: "3.13"

sphinx:
configuration: Doc/conf.py

python:
install:
- requirements: Doc/requirements_docs.txt

jobs:
pre_build:
- apt-get update && apt-get install -y doxygen graphviz
- cd Doc && doxygen Doxyfile
Loading