Skip to content

Commit ab42122

Browse files
committed
Add .gitignore and .pre-commit-config.yaml and make reuse happy
1 parent fbccadb commit ab42122

File tree

7 files changed

+486
-25
lines changed

7 files changed

+486
-25
lines changed

.gitignore

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# SPDX-FileCopyrightText: Contributors to PyPSA-Eur <https://github.com/pypsa/pypsa-eur>
2+
#
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
# Byte-compiled / optimized / DLL files
6+
__pycache__/
7+
*.py[codz]
8+
*$py.class
9+
10+
# C extensions
11+
*.so
12+
13+
# Distribution / packaging
14+
.Python
15+
build/
16+
develop-eggs/
17+
dist/
18+
downloads/
19+
eggs/
20+
.eggs/
21+
lib/
22+
lib64/
23+
parts/
24+
sdist/
25+
var/
26+
wheels/
27+
share/python-wheels/
28+
*.egg-info/
29+
.installed.cfg
30+
*.egg
31+
MANIFEST
32+
33+
# PyInstaller
34+
# Usually these files are written by a python script from a template
35+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
36+
*.manifest
37+
*.spec
38+
39+
# Installer logs
40+
pip-log.txt
41+
pip-delete-this-directory.txt
42+
43+
# Unit test / coverage reports
44+
htmlcov/
45+
.tox/
46+
.nox/
47+
.coverage
48+
.coverage.*
49+
.cache
50+
nosetests.xml
51+
coverage.xml
52+
*.cover
53+
*.py.cover
54+
.hypothesis/
55+
.pytest_cache/
56+
cover/
57+
58+
# Translations
59+
*.mo
60+
*.pot
61+
62+
# Django stuff:
63+
*.log
64+
local_settings.py
65+
db.sqlite3
66+
db.sqlite3-journal
67+
68+
# Flask stuff:
69+
instance/
70+
.webassets-cache
71+
72+
# Scrapy stuff:
73+
.scrapy
74+
75+
# Sphinx documentation
76+
docs/_build/
77+
78+
# PyBuilder
79+
.pybuilder/
80+
target/
81+
82+
# Jupyter Notebook
83+
.ipynb_checkpoints
84+
85+
# IPython
86+
profile_default/
87+
ipython_config.py
88+
89+
# UV
90+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
91+
# This is especially recommended for binary packages to ensure reproducibility, and is more
92+
# commonly ignored for libraries.
93+
uv.lock
94+
95+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
96+
__pypackages__/
97+
98+
# Environments
99+
.env
100+
.envrc
101+
.venv
102+
env/
103+
venv/
104+
ENV/
105+
env.bak/
106+
venv.bak/
107+
108+
# Spyder project settings
109+
.spyderproject
110+
.spyproject
111+
112+
# Rope project settings
113+
.ropeproject
114+
115+
# mkdocs documentation
116+
/site
117+
118+
# mypy
119+
.mypy_cache/
120+
.dmypy.json
121+
dmypy.json
122+
123+
# Pyre type checker
124+
.pyre/
125+
126+
# pytype static type analyzer
127+
.pytype/
128+
129+
# Cython debug symbols
130+
cython_debug/
131+
132+
# Visual Studio Code
133+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
134+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
135+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
136+
# you could uncomment the following to ignore the entire vscode folder
137+
.vscode/
138+
139+
# Ruff stuff:
140+
.ruff_cache/
141+
142+
# PyPI configuration file
143+
.pypirc
144+
145+
# ai coding tools
146+
CLAUDE.md
147+
.claude/
148+
.github/copilot-instructions.md
149+
CLAUDE.local.md

.pre-commit-config.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# SPDX-FileCopyrightText: Contributors to PyPSA-Eur <https://github.com/pypsa/pypsa-eur>
2+
#
3+
# SPDX-License-Identifier: CC0-1.0
4+
exclude: "^LICENSES"
5+
6+
ci:
7+
autoupdate_schedule: quarterly
8+
9+
repos:
10+
- repo: https://github.com/pre-commit/pre-commit-hooks
11+
rev: v6.0.0
12+
hooks:
13+
- id: check-merge-conflict
14+
- id: check-added-large-files
15+
args: ["--maxkb=2000"]
16+
17+
# Run ruff to lint and format
18+
- repo: https://github.com/astral-sh/ruff-pre-commit
19+
# Ruff version.
20+
rev: v0.13.3
21+
hooks:
22+
# Run the linter.
23+
- id: ruff
24+
args: [--fix]
25+
# Run the formatter.
26+
- id: ruff-format
27+
28+
# Find common spelling mistakes in comments and docstrings
29+
- repo: https://github.com/codespell-project/codespell
30+
rev: v2.4.1
31+
hooks:
32+
- id: codespell
33+
args: ['--ignore-regex="(\b[A-Z]+\b)"', '--ignore-words-list=fom,appartment,bage,ore,setis,tabacco,berfore,vor,pris,bund'] # Ignore capital case words, e.g. country codes
34+
types_or: [python, rst, markdown]
35+
files: ^(scripts|doc)/
36+
37+
# Check for FSFE REUSE compliance (licensing)
38+
- repo: https://github.com/fsfe/reuse-tool
39+
rev: v6.0.0
40+
hooks:
41+
- id: reuse-lint-file

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)