Add pre-commit configuration and documentation.

This commit is contained in:
Christian Kaiser 2024-09-10 19:58:05 -03:00 committed by David Capello
parent f5f3cc03b9
commit 102624cad3
3 changed files with 54 additions and 2 deletions

38
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,38 @@
exclude: 'third_party/.*|laf/.*'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: remove-tabs
args: [--whitespaces-count, '8']
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8
hooks:
- id: clang-format
files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx)$
types_or: [text]
- repo: https://github.com/pocc/pre-commit-hooks
rev: v1.3.5
hooks:
- id: clang-tidy
files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx)$
args: [--fix, --quiet, --use-color]
types_or: [text]
additional_dependencies: [clang-tidy==18.1.8]
require_serial: true
stages: [manual]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
additional_dependencies: [tomli]

View File

@ -16,7 +16,7 @@ Before you submit an issue:
click the `Subscribe` or `Watching` button to get notifications
via email.
# Compilation problem
# Compilation problems
Before you submit an issue or a post about a **compilation problem**,
check the following items:
@ -77,6 +77,20 @@ new [features](https://community.aseprite.org/c/features),
[bug reports](https://community.aseprite.org/c/bugs), etc. You are
encouraged to create mockups for any issue you see and attach them.
## Pre-commit hooks
We use [pre-commit](https://pre-commit.com/) as way to set up hooks, you can install it with:
```
pip install pre-commit
pre-commit install
```
If you need to run it manually, use `pre-commit run`.
To run `clang-tidy`, you can use `pre-commit run --hook-stage manual clang-tidy`.
Make sure to check the suggestions and to not apply them arbitrarily, since some might not be 100% applicable to what you're doing.
## Code submission policy
We have some rules for the changes and commits that are contributed:

View File

@ -59,7 +59,7 @@ To compile Aseprite you will need:
## Windows dependencies
* Windows 10 (we don't support cross-compiling)
* Windows 10/11 (we don't support cross-compiling)
* [Visual Studio Community 2022](https://visualstudio.microsoft.com/downloads/) (we don't support [MinGW](#mingw))
* The [Desktop development with C++ item + Windows 10.0.18362.0 SDK](https://imgur.com/a/7zs51IT)
from the Visual Studio installer