Skip to content

Commit 58b90a9

Browse files
authored
Merge pull request #5 from EnergySystemsModellingLab/initial-setup
Initial setup of repo
2 parents 2fe49eb + 103ee12 commit 58b90a9

25 files changed

Lines changed: 2539 additions & 2 deletions

.codespell_ignore.txt

Whitespace-only changes.

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
indent_style = space
8+
indent_size = 4
9+
max_line_length = 88
10+
11+
[*.md]
12+
indent_size = 2
13+
14+
[*.yaml]
15+
indent_size = 2
16+
17+
[*.yml]
18+
indent_size = 2
19+
20+
[Makefile]
21+
indent_style = tab

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Description
2+
3+
_Please include a summary of the change and which issue is fixed (if any). Please also
4+
include relevant motivation and context. List any dependencies that are required for
5+
this change._
6+
7+
Close # (issue)
8+
9+
## Type of change
10+
11+
- [ ] Documentation (non-breaking change that adds or improves the documentation)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Optimization (non-breaking, back-end change that speeds up the code)
14+
- [ ] Bug fix (non-breaking change which fixes an issue)
15+
- [ ] Breaking change (whatever its nature)
16+
17+
## Key checklist
18+
19+
- [ ] All tests pass (eg. `python -m pytest`)
20+
- [ ] Pre-commit hooks run successfully (eg. `pre-commit run --all-files`)
21+
22+
## Further checks
23+
24+
- [ ] Code is commented, particularly in hard-to-understand areas
25+
- [ ] Tests added or an issue has been opened to tackle that in the future.
26+
(Indicate issue here: # (issue))

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: uv
9+
directory: /
10+
schedule:
11+
interval: weekly
12+
- package-ecosystem: github-actions
13+
directory: /
14+
schedule:
15+
interval: weekly

.github/workflows/auto-merge.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Dependabot and Pre-commit auto-merge
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write # Needed if in a private repository
9+
10+
jobs:
11+
auto-merge:
12+
runs-on: ubuntu-latest
13+
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]' }}
14+
steps:
15+
- name: Enable auto-merge for bot PRs
16+
run: |
17+
gh pr review --approve "$PR_URL"
18+
gh pr merge --auto --merge "$PR_URL"
19+
env:
20+
PR_URL: ${{ github.event.pull_request.html_url }}
21+
# GitHub provides this variable in the CI env. You don't
22+
# need to add anything to the secrets vault.
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/check-links.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Check links in Markdown files
2+
on:
3+
schedule:
4+
- cron: 0 0 * * 1 # midnight every Monday
5+
push:
6+
branches: [main]
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
check-links:
12+
name: Lychee link checker
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v6
16+
- id: lychee
17+
uses: lycheeverse/lychee-action@v2

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Test and build
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
workflow_call:
9+
10+
jobs:
11+
test:
12+
runs-on: ${{matrix.os}}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os:
17+
- ubuntu-latest
18+
- windows-latest
19+
- macos-latest
20+
python-version: ['3.14']
21+
22+
steps:
23+
- uses: actions/checkout@v6
24+
- uses: astral-sh/setup-uv@v7
25+
with:
26+
enable-cache: true
27+
prune-cache: false
28+
activate-environment: true
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Install dependencies
32+
run: uv sync
33+
34+
- name: Run mypy
35+
run: mypy .
36+
37+
- name: Run tests
38+
run: pytest

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ cython_debug/
182182
.abstra/
183183

184184
# Visual Studio Code
185-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
185+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186186
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
187+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
188188
# you could uncomment the following to ignore the entire vscode folder
189189
# .vscode/
190190

.markdownlint.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Disable checks here
2+
MD013: false
3+
MD007:
4+
indent: 4

.pre-commit-config.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: check-merge-conflict
6+
- id: debug-statements
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: pretty-format-json
10+
args: [--autofix, --indent, '4', --no-sort]
11+
exclude: \.ipynb$
12+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
13+
rev: v2.14.0
14+
hooks:
15+
- id: pretty-format-yaml
16+
args: [--autofix, --indent, '2', --offset, '2']
17+
- repo: https://github.com/python-jsonschema/check-jsonschema
18+
rev: 0.33.1
19+
hooks:
20+
- id: check-dependabot
21+
- id: check-github-actions
22+
- id: check-github-workflows
23+
- repo: https://github.com/astral-sh/ruff-pre-commit
24+
rev: v0.12.0
25+
hooks:
26+
- id: ruff-check
27+
args: [--fix, --exit-non-zero-on-fix]
28+
- id: ruff-format
29+
- repo: https://github.com/kynan/nbstripout
30+
rev: 0.8.1
31+
hooks:
32+
- id: nbstripout
33+
- repo: https://github.com/pre-commit/mirrors-mypy
34+
rev: v1.16.1
35+
hooks:
36+
- id: mypy
37+
- repo: https://github.com/igorshubovych/markdownlint-cli
38+
rev: v0.45.0
39+
hooks:
40+
- id: markdownlint-fix
41+
- repo: https://github.com/codespell-project/codespell
42+
rev: v2.4.1
43+
hooks:
44+
- id: codespell
45+
args: [-I, .codespell_ignore.txt]
46+
- repo: https://github.com/ComPWA/taplo-pre-commit
47+
rev: v0.9.3
48+
hooks:
49+
- id: taplo-format # Format TOML files

0 commit comments

Comments
 (0)