mirror of
				https://github.com/qurator-spk/modstool.git
				synced 2025-11-04 03:14:14 +01:00 
			
		
		
		
	Merge pull request #56 from qurator-spk/pre-commit
⚙ Add pre-commit config + docs
This commit is contained in:
		
						commit
						51617a5b1e
					
				
					 4 changed files with 85 additions and 0 deletions
				
			
		
							
								
								
									
										35
									
								
								.pre-commit-config.yaml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								.pre-commit-config.yaml
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,35 @@
 | 
			
		|||
repos:
 | 
			
		||||
-   repo: https://github.com/pre-commit/pre-commit-hooks
 | 
			
		||||
    rev: v5.0.0
 | 
			
		||||
    hooks:
 | 
			
		||||
    -   id: trailing-whitespace
 | 
			
		||||
    -   id: end-of-file-fixer
 | 
			
		||||
    -   id: check-json
 | 
			
		||||
    -   id: check-toml
 | 
			
		||||
    -   id: check-yaml
 | 
			
		||||
    -   id: check-added-large-files
 | 
			
		||||
    -   id: check-ast
 | 
			
		||||
 | 
			
		||||
-   repo: https://github.com/psf/black
 | 
			
		||||
    rev: 25.1.0
 | 
			
		||||
    hooks:
 | 
			
		||||
    -   id: black
 | 
			
		||||
 | 
			
		||||
-   repo: https://github.com/astral-sh/ruff-pre-commit
 | 
			
		||||
    rev: v0.11.13
 | 
			
		||||
    hooks:
 | 
			
		||||
    -   args:
 | 
			
		||||
        -   --fix
 | 
			
		||||
        -   --exit-non-zero-on-fix
 | 
			
		||||
        id: ruff-check
 | 
			
		||||
 | 
			
		||||
-   repo: https://gitlab.com/vojko.pribudic.foss/pre-commit-update
 | 
			
		||||
    rev: v0.7.0
 | 
			
		||||
    hooks:
 | 
			
		||||
    -   id: pre-commit-update
 | 
			
		||||
 | 
			
		||||
-   repo: https://github.com/dhatim/python-license-check
 | 
			
		||||
    rev: 0.9.3
 | 
			
		||||
    hooks:
 | 
			
		||||
    -   id: liccheck
 | 
			
		||||
        language: system
 | 
			
		||||
| 
						 | 
				
			
			@ -15,3 +15,10 @@ To run a test with profiling:
 | 
			
		|||
  ```
 | 
			
		||||
  pytest --profile-svg -k test_page_info
 | 
			
		||||
  ```
 | 
			
		||||
 | 
			
		||||
# How to use pre-commit
 | 
			
		||||
 | 
			
		||||
This project optionally uses [pre-commit](https://pre-commit.com) to check commits. To use it:
 | 
			
		||||
 | 
			
		||||
- Install pre-commit, e.g. `pip install -r requirements-dev.txt`
 | 
			
		||||
- Install the repo-local git hooks: `pre-commit install`
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -44,3 +44,42 @@ optional-dependencies.dev = {file = ["requirements-dev.txt"]}
 | 
			
		|||
 | 
			
		||||
[tool.setuptools.packages.find]
 | 
			
		||||
where = ["src"]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
[tool.ruff.lint]
 | 
			
		||||
select = ["E", "F", "I"]
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
[tool.liccheck]
 | 
			
		||||
authorized_licenses = [
 | 
			
		||||
    "bsd",
 | 
			
		||||
    "new bsd",
 | 
			
		||||
    "bsd license",
 | 
			
		||||
    "new bsd license",
 | 
			
		||||
    "simplified bsd",
 | 
			
		||||
    "apache",
 | 
			
		||||
    "apache 2.0",
 | 
			
		||||
    "apache software license",
 | 
			
		||||
    "apache software",
 | 
			
		||||
    "apache license 2.0",
 | 
			
		||||
    "gnu lgpl",
 | 
			
		||||
    "lgpl with exceptions or zpl",
 | 
			
		||||
    "GNU Library or Lesser General Public License (LGPL)",
 | 
			
		||||
    "GNU Lesser General Public License v3 (LGPLv3)",
 | 
			
		||||
    "GNU Lesser General Public License v2 or later (LGPLv2+)",
 | 
			
		||||
    "mit",
 | 
			
		||||
    "mit license",
 | 
			
		||||
    "mit-cmu",
 | 
			
		||||
    "python software foundation",
 | 
			
		||||
    "psf",
 | 
			
		||||
    "psf-2.0",
 | 
			
		||||
    "Historical Permission Notice and Disclaimer (HPND)",
 | 
			
		||||
    "public domain",
 | 
			
		||||
    'The Unlicense (Unlicense)',
 | 
			
		||||
    "isc",
 | 
			
		||||
    "ISC License (ISCL)",
 | 
			
		||||
    'Mozilla Public License 2.0 (MPL 2.0)',
 | 
			
		||||
]
 | 
			
		||||
unauthorized_licenses = [
 | 
			
		||||
    "gpl v3",
 | 
			
		||||
]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,3 +7,7 @@ mypy
 | 
			
		|||
types-lxml
 | 
			
		||||
types-tqdm
 | 
			
		||||
pandas-stubs
 | 
			
		||||
 | 
			
		||||
pre-commit
 | 
			
		||||
setuptools
 | 
			
		||||
liccheck
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue