Skip to content

Commit 7baa9a9

Browse files
committed
🔧 config(template): add support for .editorconfig and format files accordingly
1 parent 50f1fbd commit 7baa9a9

File tree

7 files changed

+84
-28
lines changed

7 files changed

+84
-28
lines changed

‎.editorconfig‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*{yaml,yml}]
12+
indent_size = 2
13+
14+
[*.json]
15+
indent_size = 2
16+
17+
[*.lua]
18+
indent_size = 2
19+
20+
[*.xml]
21+
indent_size = 2
22+
23+
[*.md]
24+
trim_trailing_whitespace = false
25+
26+
[Makefile]
27+
indent_style = tab
28+
trim_trailing_whitespace = false

‎.renovaterc.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"datasourceTemplate": "github-tags",
2929
"depNameTemplate": "{{{ depName }}}",
3030
"extractVersionTemplate": "{{currentValue}}",
31-
"versioningTemplate": "semver-coerced",
31+
"versioningTemplate": "semver",
3232
"matchStrings": [
3333
"(?ms)^\\s*-\\s*repo:\\s*https?://github\\.com/(?<depName>[^/\\s]+/[^/\\s]+)\\b.*?\\n\\s*rev:\\s*[\"']?(?<currentValue>v?\\d+\\.\\d+\\.\\d+)[\"']?"
3434
],

‎template/.editorconfig‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*{yaml,yml}]
12+
indent_size = 2
13+
14+
[*.json]
15+
indent_size = 2
16+
17+
[*.lua]
18+
indent_size = 2
19+
20+
[*.xml]
21+
indent_size = 2
22+
23+
[*.md]
24+
trim_trailing_whitespace = false
25+
26+
[Makefile]
27+
indent_style = tab
28+
trim_trailing_whitespace = false

‎template/.pre-commit-config.yaml.jinja‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@ repos:
4141
- repo: https://github.com/commitizen-tools/commitizen
4242
rev: v4.5.1
4343
hooks:
44-
- id: commitizen
45-
{%- if cz_gitmoji %}
46-
{%- if repository_provider == 'github' %}
47-
# needed by Renovate to support additional dependencies
48-
# see https://docs.renovatebot.com/modules/manager/pre-commit/
49-
language: python
50-
{%- endif %}
51-
additional_dependencies:
52-
- cz-conventional-gitmoji
53-
{%- endif %}
54-
stages:
55-
- commit-msg
44+
- id: commitizen
45+
{%- if cz_gitmoji %}
46+
{%- if repository_provider == 'github' %}
47+
# needed by Renovate to support additional dependencies
48+
# see https://docs.renovatebot.com/modules/manager/pre-commit/
49+
language: python
50+
{%- endif %}
51+
additional_dependencies:
52+
- cz-conventional-gitmoji
53+
{%- endif %}
54+
stages:
55+
- commit-msg
5656
{%- endif %}
5757

5858
- repo: https://github.com/astral-sh/ruff-pre-commit

‎template/mkdocs.yml.jinja‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ plugins:
2323
paths: ["src/{{ project_slug }}"]
2424
options:
2525
extensions:
26-
- griffe_typingdoc
26+
- griffe_typingdoc
2727
show_root_heading: true
2828
show_if_no_docstring: true
2929
# preload_modules:
@@ -34,7 +34,7 @@ plugins:
3434
separate_signature: true
3535
unwrap_annotated: true
3636
filters:
37-
- '!^_'
37+
- "!^_"
3838
merge_init_into_class: true
3939
docstring_section_style: spacy
4040
signature_crossrefs: true

‎template/{% if dockerfile %}Dockerfile{% endif %}.jinja‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ WORKDIR /workspaces/{{ project_name }}
1616

1717
# Install dependencies
1818
RUN --mount=type=cache,target=/root/.cache/uv \
19-
--mount=type=bind,source=uv.lock,target=uv.lock \
20-
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
21-
if [ "$ENVIRONMENT" = "prod" ]; then \
22-
uv sync --frozen --no-install-project --no-editable --no-dev; \
23-
else \
24-
uv sync --frozen --no-install-project --all-extras; \
25-
fi
19+
--mount=type=bind,source=uv.lock,target=uv.lock \
20+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
21+
if [ "$ENVIRONMENT" = "prod" ]; then \
22+
uv sync --frozen --no-install-project --no-editable --no-dev; \
23+
else \
24+
uv sync --frozen --no-install-project --all-extras; \
25+
fi
2626

2727
COPY . .
2828

2929
# Install the project
3030
RUN --mount=type=cache,target=/root/.cache/uv \
31-
if [ "$ENVIRONMENT" = "prod" ]; then \
32-
uv sync --frozen --no-editable --no-dev; \
33-
else \
34-
uv sync --frozen --all-extras; \
35-
fi
31+
if [ "$ENVIRONMENT" = "prod" ]; then \
32+
uv sync --frozen --no-editable --no-dev; \
33+
else \
34+
uv sync --frozen --all-extras; \
35+
fi
3636

3737
# ---------- production image ----------
3838
FROM python:{{ python_version }}-slim-bookworm AS prod

‎template/{% if dockerfile %}compose.yaml{% endif %}.jinja‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ services:
3535
- "8080:8080"
3636
stdin_open: true
3737
tty: true
38-
command: [ "sh" ]
38+
command: ["sh"]
3939
{%- if gpus %}
4040
deploy:
4141
resources:

0 commit comments

Comments
 (0)