chore: Sync with WeblateOrg/meta

This commit is contained in:
Michal Čihař 2025-04-08 11:34:05 +02:00
parent ab37307e84
commit 2a35b4acab
5 changed files with 56 additions and 8 deletions

40
.editorconfig Normal file
View file

@ -0,0 +1,40 @@
# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: CC0-1.0

# This file is maintained in https://github.com/WeblateOrg/meta/

root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
spaces_around_operators = true

[*.bat]
end_of_line = crlf

[*.html]
indent_size = 2

[*.py]
indent_size = 4

[*.rst]
indent_size = 3

[*.js]
quote_type = double

[*.{markdown,md}]
trim_trailing_whitespace = false

[[shell]]
indent_style = space
indent_size = 4
space_redirects = true
simplify = true

View file

@ -52,7 +52,8 @@
},
{
"matchPackageNames": [
"shellcheck-py/shellcheck-py"
"shellcheck-py/shellcheck-py",
"scop/pre-commit-shfmt"
],
"versioning": "loose"
},

View file

@ -44,13 +44,13 @@ jobs:
fi
- name: pre-commit (PEP 735)
if: steps.detect.outputs.method == 'pep735'
run: uv run --no-sources --only-group pre-commit pre-commit run --all
run: uv run --no-sources --only-group pre-commit pre-commit run --all --show-diff-on-failure
env:
RUFF_OUTPUT_FORMAT: github
REUSE_OUTPUT_FORMAT: github
- name: pre-commit (uvx)
if: steps.detect.outputs.method == 'uvx'
run: uvx pre-commit run --all
run: uvx pre-commit run --all --show-diff-on-failure
env:
RUFF_OUTPUT_FORMAT: github
REUSE_OUTPUT_FORMAT: github
@ -62,7 +62,7 @@ jobs:
run: uv pip install --system "$(sed -n 's/.*"\(pre-commit==\([^"]*\)\)".*/\1/p' pyproject.toml)"
- name: pre-commit (installed)
if: steps.detect.outputs.method == 'requirements' || steps.detect.outputs.method == 'pyproject'
run: pre-commit run --all
run: pre-commit run --all --show-diff-on-failure
env:
RUFF_OUTPUT_FORMAT: github
REUSE_OUTPUT_FORMAT: github

View file

@ -29,10 +29,6 @@ repos:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/asottile/blacken-docs
rev: 1.19.1
hooks:
- id: blacken-docs
- repo: meta
hooks:
- id: check-hooks-apply
@ -83,5 +79,13 @@ repos:
rev: v1.7.7
hooks:
- id: actionlint
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.19.1
hooks:
- id: blacken-docs
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.11.0-1
hooks:
- id: shfmt
ci:
autoupdate_schedule: quarterly

View file

@ -103,6 +103,9 @@ profile = "black"
[tool.ruff]
target-version = "py39"

[tool.ruff.format]
docstring-code-format = true

[tool.ruff.lint]
ignore = [
"COM812", # CONFIG: trailing newlines