Skip to content

Commit 1f79ec2

Browse files
authored
Merge pull request #935 from feldroy/add-pre-commit-hooks
Add pre-commit-hooks: Some out-of-the-box hooks for pre-commit.
2 parents 35f90e2 + 12d4af9 commit 1f79ec2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+211
-154
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ assignees: ''
1010

1111
Tell us what is broken. If possible, add code and screen shots demonstrating the nature of the problem.
1212

13-
**Expected outcome**
13+
**Expected outcome**
1414

1515
How should things be working? If possible, add code and screen shots
1616

.github/ISSUE_TEMPLATE/doc_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Documentation Request
3-
about: A project lives and breathes on the quality of its documentation.
3+
about: A project lives and breathes on the quality of its documentation.
44
title: 'DOCS: '
55
labels: docs
66
assignees: ''

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Feature Request
3-
about: Most feature requests for air core are probably best executed as a new package.
3+
about: Most feature requests for air core are probably best executed as a new package.
44
title: 'FEAT: '
55
labels: feature
66
assignees: ''

.github/pull_request_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- A summary of the changes made here. -->
2-
<!-- Add any links to other issues or secondary material. -->
2+
<!-- Add any links to other issues or secondary material. -->
33

44
# Issue(s)
55

@@ -47,4 +47,4 @@ The following have been completed for this task:
4747
## Other information
4848

4949
<!-- If there's anything else not covered above, provide it here -->
50-
<!-- If there's nothing else, remove this section. -->
50+
<!-- If there's nothing else, remove this section. -->

.github/workflows/publish-docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
- name: Install just
3333
uses: taiki-e/install-action@just
3434
- name: Measuring Coverage • macOS
35-
run: just doc-build
35+
run: just doc-build

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,4 @@ AGENT.md.bak
102102
GEMINI.md
103103
GEMINI.md.bak
104104
# END Ruler Generated Files
105-
src/air/templates
105+
src/air/templates

.pre-commit-config-check.yaml

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,47 @@
33
# Note: we are using https://github.com/j178/prek a better `pre-commit`, re-engineered in Rust!
44
# See https://prek.j178.dev/configuration for more information
55
# See https://prek.j178.dev/builtin for more hooks
6+
ci:
7+
autofix_prs: false
8+
fail_fast: false
69
repos:
10+
- repo: builtin
11+
hooks:
12+
- id: check-added-large-files # Prevent giant files from being committed.
13+
- id: check-case-conflict # Check for files that would conflict in case-insensitive filesystems.
14+
- id: check-executables-have-shebangs # Checks that non-binary executables have a proper shebang.
15+
- id: check-json # Attempts to load all json files to verify syntax.
16+
- id: check-merge-conflict # Check for files that contain merge conflict strings.
17+
- id: check-symlinks # Checks for symlinks which do not point to anything.
18+
- id: check-toml # Attempts to load all TOML files to verify syntax.
19+
- id: check-yaml # Attempts to load all yaml files to verify syntax.
20+
args: [ '--allow-multiple-documents' ]
21+
- id: detect-private-key # Checks for the existence of private keys.
22+
- id: end-of-file-fixer # Ensure newline at EOF.
23+
- id: fix-byte-order-marker # Remove UTF-8 byte order marker.
24+
- id: mixed-line-ending # Replaces or checks mixed line ending.
25+
- id: no-commit-to-branch # Protect specific branches from direct checkins.
26+
- id: trailing-whitespace # Trim trailing whitespace.
27+
- repo: https://github.com/pre-commit/pre-commit-hooks
28+
rev: v6.0.0
29+
hooks:
30+
- id: check-ast # Simply check whether files parse as valid python.
31+
- id: check-shebang-scripts-are-executable # Checks that scripts with shebangs are executable.
32+
- id: check-vcs-permalinks # Ensures that links to vcs websites are permalinks.
33+
- id: forbid-new-submodules # Prevent addition of new git submodules.
34+
- id: name-tests-test # verifies that test files are named correctly.
35+
args: [ '--pytest-test-first' ]
36+
exclude: ^tests/(utils|components)\.py$
37+
- id: pretty-format-json # Checks that all your JSON files are pretty(keys are sorted and indented).
738
- repo: https://github.com/adamchainz/blacken-docs
8-
rev: '1.20.0'
39+
rev: 1.20.0
940
hooks:
10-
- id: blacken-docs
41+
- id: blacken-docs # Run Black on Python code blocks in documentation files.
1142
additional_dependencies:
1243
- black==25.12.0
1344
args: [ '--check', '--preview', '--line-length=79' ]
1445
- repo: https://github.com/rtts/djhtml
15-
rev: '3.0.1'
46+
rev: 3.0.10
1647
hooks:
17-
- id: djhtml
48+
- id: djhtml # A pure-Python Django/Jinja template indenter without dependencies.
1849
entry: djhtml --check --tabwidth 2
19-
- id: djcss
20-
entry: djcss --check --tabwidth 2
21-
- id: djjs
22-
entry: djjs --check --tabwidth 2

.pre-commit-config-format.yaml

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,48 @@
33
# Note: we are using https://github.com/j178/prek a better `pre-commit`, re-engineered in Rust!
44
# See https://prek.j178.dev/configuration for more information
55
# See https://prek.j178.dev/builtin for more hooks
6+
ci:
7+
autofix_prs: false
8+
fail_fast: false
69
repos:
10+
- repo: builtin
11+
hooks:
12+
- id: check-added-large-files # Prevent giant files from being committed.
13+
- id: check-case-conflict # Check for files that would conflict in case-insensitive filesystems.
14+
- id: check-executables-have-shebangs # Checks that non-binary executables have a proper shebang.
15+
- id: check-json # Attempts to load all json files to verify syntax.
16+
- id: check-merge-conflict # Check for files that contain merge conflict strings.
17+
- id: check-symlinks # Checks for symlinks which do not point to anything.
18+
- id: check-toml # Attempts to load all TOML files to verify syntax.
19+
- id: check-yaml # Attempts to load all yaml files to verify syntax.
20+
args: [ '--allow-multiple-documents' ]
21+
- id: detect-private-key # Checks for the existence of private keys.
22+
- id: end-of-file-fixer # Ensure newline at EOF.
23+
- id: fix-byte-order-marker # Remove UTF-8 byte order marker.
24+
- id: mixed-line-ending # Replaces or checks mixed line ending.
25+
- id: no-commit-to-branch # Protect specific branches from direct checkins.
26+
- id: trailing-whitespace # Trim trailing whitespace.
27+
- repo: https://github.com/pre-commit/pre-commit-hooks
28+
rev: v6.0.0
29+
hooks:
30+
- id: check-ast # Simply check whether files parse as valid python.
31+
- id: check-shebang-scripts-are-executable # Checks that scripts with shebangs are executable.
32+
- id: check-vcs-permalinks # Ensures that links to vcs websites are permalinks.
33+
- id: forbid-new-submodules # Prevent addition of new git submodules.
34+
- id: name-tests-test # verifies that test files are named correctly.
35+
args: [ '--pytest-test-first' ]
36+
exclude: ^tests/(utils|components)\.py$
37+
- id: pretty-format-json # Checks that all your JSON files are pretty(keys are sorted and indented).
38+
args: [ '--autofix' ]
739
- repo: https://github.com/adamchainz/blacken-docs
8-
rev: '1.20.0'
40+
rev: 1.20.0
941
hooks:
10-
- id: blacken-docs
42+
- id: blacken-docs # Run Black on Python code blocks in documentation files.
1143
additional_dependencies:
1244
- black==25.12.0
1345
args: [ '--preview', '--line-length=79' ]
1446
- repo: https://github.com/rtts/djhtml
15-
rev: '3.0.1'
47+
rev: 3.0.10
1648
hooks:
17-
- id: djhtml
49+
- id: djhtml # A pure-Python Django/Jinja template indenter without dependencies.
1850
entry: djhtml --tabwidth 2
19-
- id: djcss
20-
entry: djcss --tabwidth 2
21-
- id: djjs
22-
entry: djjs --tabwidth 2

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
* FEAT: Introduced two new class methods to `BaseTag` in `src/air/tags/models/base.py` by @pygarap in https://github.com/feldroy/air/pull/917:
1212
- `from_html_file` for building an air-tag tree from a file
1313
- `from_html_file_to_source` for generating the instantiable source from a file
14-
14+
1515
### Refactoring
16-
16+
1717
* REFACTOR: Type Annotations Adjustments in the `air.tags.models.base.BaseTag` class! by @pygarap in https://github.com/feldroy/air/pull/914
1818
* REFACTOR: rename `kwargs` to `custom_attributes` for improved clarity! by @pygarap in https://github.com/feldroy/air/pull/915
1919
* REFACTOR: reorganize test files into `tags` subdirectory! by @pygarap in https://github.com/feldroy/air/pull/916
@@ -82,8 +82,8 @@
8282
- `BaseTag.first_attribute`
8383
- `BaseTag.last_attribute`
8484
- `BaseTag.num_of_direct_children`
85-
- `BaseTag.num_of_attributes`
86-
- `BaseTag.tag_id`
85+
- `BaseTag.num_of_attributes`
86+
- `BaseTag.tag_id`
8787
* [CHORE] Remove FURB189 ruff rule by @msaizar in https://github.com/feldroy/air/pull/872
8888
* [CHORE] Add 100% test coverage to missing_examples script by @msaizar in https://github.com/feldroy/air/pull/873
8989
* [CHORE] Add baseline and check modes for scripts/missing_examples.py by @msaizar in https://github.com/feldroy/air/pull/874

docs/about/roadmap.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ There are a number of accessibility improvements that we can make, mostly for bu
4444

4545
### Bringing AirMarkdown Into Air Core
4646

47-
AirMarkdown is currently a separate package. While it works, it is extremely challenging to alter the configuration. In trying to fix it we discovered that the architecture of AirMarkdown is not quite right, and when combined with the extra layer of abstraction in having it as a separate package makes it hard to correct.
47+
AirMarkdown is currently a separate package. While it works, it is extremely challenging to alter the configuration. In trying to fix it we discovered that the architecture of AirMarkdown is not quite right, and when combined with the extra layer of abstraction in having it as a separate package makes it hard to correct.
4848

4949
Our plan is to bring AirMarkdown into Air core with an optional dependency group, and redesign the architecture to make it more flexible and easier to configure. Then we'll extract it again once we're happy with the result.
5050

@@ -68,7 +68,7 @@ This will be a layout library that provides elegant defaults for making awesome
6868

6969
Tools like [shadcn](https://ui.shadcn.com/) and other Tailwind-powered projects are really powerful, but require an understanding of CSS (or tailwind) to be able to use. AirComponents will address this through intelligent defaults so those of us who don't know CSS can use it to make incredible looking sites. Yet AirComponents will be built so that it can be easily modified to support all kinds of usecases.
7070

71-
AirComponents may be a separate repo and package, managed in its own [GitHub repo](https://github.com/feldroy/AirComponents). That will allow for faster velocity and provide room for playing with architecture and design.
71+
AirComponents may be a separate repo and package, managed in its own [GitHub repo](https://github.com/feldroy/AirComponents). That will allow for faster velocity and provide room for playing with architecture and design.
7272

7373
## What's already been completed
7474

@@ -86,4 +86,4 @@ What we really like is that AirResponse is so flexible. It can return Jinja temp
8686

8787
In working on the blog tutorial as well as professional projects it has become clear that tying Air to SQLModel/SQLAlchemy is really powerful. However, the configuration is a bit clunky and documentation for it is almost non-existent or full of errors. This means that humans and LLMs alike struggle to understand how to use it.
8888

89-
The goal is Air ORM is include helper tools to make using SQLModel/SQLAlchemy easier, as well as better documentation and examples.
89+
The goal is Air ORM is include helper tools to make using SQLModel/SQLAlchemy easier, as well as better documentation and examples.

0 commit comments

Comments
 (0)