Skip to content

Commit 19207de

Browse files
committed
chore: setup maintenance tools
1 parent 7b3cf64 commit 19207de

9 files changed

+2343
-1
lines changed

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,17 @@ build
99
_build
1010
build
1111
_site
12+
.mypy_cache
13+
.pytest_cache
14+
.ruff_cache
15+
16+
# Node
17+
node_modules/
1218

1319
# IDEs
14-
.vscode/
20+
.vscode/*
21+
!.vscode/*.sample
22+
!.vscode/extensions.json
1523

1624
# Sphinx
1725
.doctrees

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm run commitlint ${1}

.husky/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
npm run lint-staged
2+
npm test

.vscode/extensions.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4+
// List of extensions which should be recommended for users of this workspace.
5+
"recommendations": [
6+
// Prettier formatter
7+
"esbenp.prettier-vscode",
8+
9+
// Python ruff formatter and linter
10+
"charliermarsh.ruff"
11+
],
12+
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
13+
"unwantedRecommendations": []
14+
}

.vscode/launch.json.sample

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "sphinx-build",
6+
"type": "debugpy",
7+
"request": "launch",
8+
"program": ".venv/bin/sphinx-build",
9+
"args": ["-M", "linkcheck", "tests/roots/test-linkcheck", "tests/roots/test-linkcheck/_build"],
10+
"console": "integratedTerminal",
11+
"justMyCode": false,
12+
"env": {
13+
"PYTHONWARNDEFAULTENCODING": "1"
14+
}
15+
}
16+
]
17+
}

.vscode/settings.json.sample

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
// Format on save
3+
"editor.formatOnSave": true,
4+
5+
// Format and lint Python with Ruff
6+
"[python]": {
7+
"editor.defaultFormatter": "charliermarsh.ruff",
8+
"editor.codeActionsOnSave": {
9+
// Fix all issues on save
10+
"source.fixAll": "explicit",
11+
// Organize imports on save
12+
"source.organizeImports": "explicit"
13+
}
14+
},
15+
16+
// Format everything else with Prettier
17+
"editor.defaultFormatter": "esbenp.prettier-vscode",
18+
19+
// Pytest support
20+
"python.testing.unittestEnabled": false,
21+
"python.testing.pytestEnabled": true,
22+
"python.testing.pytestArgs": ["-vv", "--color=yes", "tests"]
23+
}

cliff.toml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# git-cliff ~ configuration file
2+
# https://git-cliff.org/docs/configuration
3+
4+
[changelog]
5+
# template for the changelog header
6+
header = """
7+
# Changelog\n
8+
All notable changes to this project will be documented in this file.
9+
10+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
11+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n
12+
"""
13+
# template for the changelog body
14+
# https://keats.github.io/tera/docs/#introduction
15+
body = """
16+
{% if version -%}
17+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
18+
{% else -%}
19+
## [Unreleased]
20+
{% endif -%}
21+
{% for group, commits in commits | group_by(attribute="group") %}
22+
### {{ group | upper_first }}
23+
{% for commit in commits %}
24+
- {{ commit.message | split(pat="\n") | first | upper_first | trim }}\
25+
{% endfor %}
26+
{% endfor %}\n
27+
"""
28+
# template for the changelog footer
29+
footer = """
30+
{% for release in releases -%}
31+
{% if release.version -%}
32+
{% if release.previous.version -%}
33+
[{{ release.version | trim_start_matches(pat="v") }}]: \
34+
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
35+
/compare/{{ release.previous.version }}..{{ release.version }}
36+
{% endif -%}
37+
{% else -%}
38+
[unreleased]: https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
39+
/compare/{{ release.previous.version }}..HEAD
40+
{% endif -%}
41+
{% endfor %}
42+
<!-- generated by git-cliff -->
43+
"""
44+
# remove the leading and trailing whitespace from the templates
45+
trim = true
46+
47+
[git]
48+
# parse the commits based on https://www.conventionalcommits.org
49+
conventional_commits = true
50+
# filter out the commits that are not conventional
51+
filter_unconventional = false
52+
# regex for parsing and grouping commits
53+
commit_parsers = [
54+
{ message = "^[a|A]dd", group = "Added" },
55+
{ message = "^[s|S]upport", group = "Added" },
56+
{ message = "^[r|R]emove", group = "Removed" },
57+
{ message = "^.*: add", group = "Added" },
58+
{ message = "^.*: support", group = "Added" },
59+
{ message = "^.*: remove", group = "Removed" },
60+
{ message = "^.*: delete", group = "Removed" },
61+
{ message = "^test", group = "Fixed" },
62+
{ message = "^fix", group = "Fixed" },
63+
{ message = "^.*: fix", group = "Fixed" },
64+
{ message = "^.*", group = "Changed" },
65+
]
66+
# filter out the commits that are not matched by commit parsers
67+
filter_commits = false
68+
# sort the tags topologically
69+
topo_order = false
70+
# sort the commits inside sections by oldest/newest order
71+
sort_commits = "newest"

0 commit comments

Comments
 (0)