This is an automated email from the ASF dual-hosted git repository. sbp pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tooling-asf-example.git
commit 9e94bd12dc52e80ca9278322dc9302c397bbbbf1 Author: Sean B. Palmer <[email protected]> AuthorDate: Wed Aug 13 16:06:55 2025 +0100 Add lints --- .pre-commit-config.yaml | 55 +++++++++++++++++++++++++++++++++++++++++++++ share/apache-2.0_header.txt | 16 +++++++++++++ 2 files changed, 71 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..a006151 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,55 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-ast + - id: check-case-conflict + - id: check-executables-have-shebangs + - id: check-illegal-windows-names + - id: check-merge-conflict + - id: check-shebang-scripts-are-executable + - id: check-toml + - id: check-vcs-permalinks + - id: check-yaml + - id: detect-private-key + - id: end-of-file-fixer + - id: fix-byte-order-marker + - id: forbid-submodules + - id: mixed-line-ending + - id: trailing-whitespace +- repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.5.5 + hooks: + - id: insert-license + name: Add license for all Python files + files: ^src/(.*\.py$|.*\.pyi)$ + args: + - --comment-style + - "|#|" + - --license-filepath + - share/apache-2.0_header.txt + - --fuzzy-match-generates-todo +- repo: https://github.com/shellcheck-py/shellcheck-py + rev: v0.10.0.1 + hooks: + - id: shellcheck +- repo: local + hooks: + - id: ruff + name: Ruff Linter + entry: uv run ruff check --fix + language: system + types: [python] + + - id: ruff-format + name: Ruff Formatter + entry: uv run ruff format --force-exclude + language: system + types: [python] + + - id: pyright + name: Pyright Type Check + entry: uv run pyright + language: system + require_serial: true + types: [python] diff --git a/share/apache-2.0_header.txt b/share/apache-2.0_header.txt new file mode 100644 index 0000000..60b675e --- /dev/null +++ b/share/apache-2.0_header.txt @@ -0,0 +1,16 @@ +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
