Skip to content

Commit a616554

Browse files
committed
👷 uv + taskfile
1 parent 0363f13 commit a616554

File tree

3 files changed

+153
-151
lines changed

3 files changed

+153
-151
lines changed

.pre-commit-config.yaml

Lines changed: 47 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,48 @@
1+
# yaml-language-server: $schema=https://schemastore.org/pre-commit-config.json
12
repos:
2-
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v6.0.0
4-
hooks:
5-
- id: trailing-whitespace
6-
exclude: '\.ambr$'
7-
- id: end-of-file-fixer
8-
- id: check-yaml
9-
- id: check-ast
10-
- id: check-docstring-first
11-
- id: check-merge-conflict
12-
- id: mixed-line-ending
13-
14-
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
15-
rev: v2.15.0
16-
hooks:
17-
- id: pretty-format-toml
18-
args: [--autofix, --no-sort]
19-
20-
- repo: https://github.com/pre-commit/mirrors-prettier
21-
rev: v4.0.0-alpha.8
22-
hooks:
23-
- id: prettier
24-
args: [--print-width=88, --tab-width=4]
25-
exclude: |
26-
(?x)(
27-
docs/|
28-
PULL_REQUEST_TEMPLATE.md|
29-
.github/semantic_release/release_notes.hbs
30-
)
31-
32-
- repo: local
33-
hooks:
34-
- id: ruff-format
35-
name: format
36-
description: Runs Code Auto-Formatters
37-
entry: uv run ruff format
38-
language: system
39-
types:
40-
- python
41-
- id: ruff-check
42-
name: lint
43-
description: Runs Code Linters
44-
entry: uv run ruff check --fix
45-
language: system
46-
types:
47-
- python
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v6.0.0
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: check-yaml
9+
- id: check-ast
10+
- id: check-docstring-first
11+
- id: check-merge-conflict
12+
- id: mixed-line-ending
13+
- id: no-commit-to-branch
14+
- repo: https://github.com/google/yamlfmt
15+
rev: v0.17.2
16+
hooks:
17+
- id: yamlfmt
18+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
19+
rev: v2.15.0
20+
hooks:
21+
- id: pretty-format-toml
22+
args: [--autofix, --no-sort]
23+
- repo: https://github.com/hukkin/mdformat
24+
rev: 0.7.22
25+
hooks:
26+
- id: mdformat
27+
args: ["--number"]
28+
additional_dependencies:
29+
- mdformat-gfm
30+
- mdformat-gfm-alerts
31+
- mdformat-ruff
32+
- mdformat-config
33+
- repo: local
34+
hooks:
35+
- id: ruff-format
36+
name: format
37+
description: Runs Code Auto-Formatters
38+
entry: uv run ruff format
39+
language: system
40+
types:
41+
- python
42+
- id: ruff-check
43+
name: lint
44+
description: Runs Code Linters
45+
entry: uv run ruff check --fix
46+
language: system
47+
types:
48+
- python

docs/contributing.md

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,54 @@
22

33
## Environment Setup
44

5-
This project requires two core dependencies: **[uv](https://docs.astral.sh/uv/)** (Python package
6-
manager) and **[Task](https://taskfile.dev/)** (task runner). Once both are installed, you can use
5+
This project requires two core dependencies: **[uv]** (Python package
6+
manager) and **[task]** (task runner). Once both are installed, you can use
77
`task` to interact with the project for all development workflows.
88

99
1. [Install uv](https://docs.astral.sh/uv/getting-started/installation/)
1010

11-
```shell
12-
curl -LsSf https://astral.sh/uv/install.sh | sh
13-
```
11+
```shell
12+
curl -LsSf https://astral.sh/uv/install.sh | sh
13+
```
1414

15-
2. [Install Task](https://taskfile.dev/installation/)
15+
2. [Install task](https://taskfile.dev/installation/)
1616

17-
```shell
18-
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
19-
```
17+
```shell
18+
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
19+
```
2020

2121
3. Install project dependencies and list available tasks
2222

23-
```shell
24-
task install
25-
```
23+
```shell
24+
task install
25+
```
2626

2727
4. Optionally, activate the virtual environment created by `uv`:
2828

29-
```shell
30-
source .venv/bin/activate
31-
```
29+
```shell
30+
source .venv/bin/activate
31+
```
3232

3333
## Using Task
3434

3535
### Task Cheat Sheet
3636

37-
| Command Description | Command | Notes |
38-
| -------------------------- | ----------------- | ---------------------------------------- |
39-
| Install Dependencies | `task install` | Installs project and dev dependencies |
40-
| Run Tests | `task test` | Runs tests with `pytest` |
41-
| Run Linting | `task lint` | Runs `ruff check`, formatting, and type checks |
42-
| Fix Code Issues | `task fix` | Auto-fixes issues with `ruff format` and `ruff check --fix` |
43-
| Run Formatting | `task fmt` | Runs `ruff format` code formatter |
44-
| Run Type Checking | `task check` | Runs `mypy` static type checker |
45-
| Build Project | `task build` | Builds project artifacts |
46-
| Update Dependencies | `task lock` | Regenerates `uv.lock` lockfile |
47-
| Serve Documentation | `task docs` | Serves docs with `mkdocs` |
48-
| Run Commands | `task run -- <cmd>`| Runs arbitrary commands |
37+
| Command Description | Command | Notes |
38+
| ------------------- | ------------------- | --------------------------------------- |
39+
| Install Project | `task install` | Installs project and dev dependencies |
40+
| Run Tests | `task test` | Runs tests with `pytest` |
41+
| Run Linting | `task lint` | Lints code with `ruff` |
42+
| Fix Code Issues | `task fix` | Formats and auto-fixes code with `ruff` |
43+
| Run Formatting | `task fmt` | Formats code with `ruff` |
44+
| Run Type Checking | `task check` | Runs static analysis with `mypy` |
45+
| Build Project | `task build` | Builds project artifacts |
46+
| Update Dependencies | `task lock` | Regenerates project lockfile |
47+
| Serve Documentation | `task docs` | Serves docs with `mkdocs` |
48+
| Run Commands | `task run -- <cmd>` | Runs arbitrary commands |
4949

5050
### Task Explanation
5151

52-
Task is a task runner built in Go that aims to be simpler and easier to use than GNU Make.
52+
`task` is a task runner built in Go that aims to be simpler and easier to use than GNU Make.
5353
Task uses a `Taskfile.yaml` file to define tasks and their dependencies. This project
5454
uses Task to organize and run common development operations like testing, linting,
5555
building, and documentation generation.
@@ -86,7 +86,7 @@ task run -- python -m browsr --help
8686
```
8787

8888
You can also run tasks from subdirectories, and Task will automatically
89-
find and use the Taskfile.yaml from the project root.
89+
find and use the `Taskfile.yaml` from the project root.
9090

9191
## Committing Code
9292

@@ -104,11 +104,11 @@ commit message emoji prefixes are the only ones to trigger new releases:
104104

105105
| Emoji | Shortcode | Description | Semver |
106106
| ----- | ------------- | --------------------------- | ------ |
107-
| 💥 | \:boom\: | Introduce breaking changes. | Major |
108-
|| \:sparkles\: | Introduce new features. | Minor |
109-
| 🐛 | \:bug\: | Fix a bug. | Patch |
110-
| 🚑 | \:ambulance\: | Critical hotfix. | Patch |
111-
| 🔒 | \:lock\: | Fix security issues. | Patch |
107+
| 💥 | `:boom:` | Introduce breaking changes. | Major |
108+
|| `:sparkles:` | Introduce new features. | Minor |
109+
| 🐛 | `:bug:` | Fix a bug. | Patch |
110+
| 🚑 | `:ambulance:` | Critical hotfix. | Patch |
111+
| 🔒 | `:lock:` | Fix security issues. | Patch |
112112

113113
Most features can be squash merged into a single commit on a pull-request.
114114
When merging multiple commits, they will be summarized into a single release.
@@ -158,10 +158,11 @@ would create a branch named `1.2.x` and merge your changes into that branch.
158158
See the [semantic-release documentation] for more information about
159159
branch based releases and other advanced release cases.
160160

161-
[pipx]: https://pypa.github.io/pipx/
162-
[pre-commit]: https://pre-commit.com/
163-
[gitmoji]: https://gitmoji.dev/
164161
[conventional commits]: https://www.conventionalcommits.org/en/v1.0.0/
162+
[gitmoji]: https://gitmoji.dev/
163+
[pre-commit]: https://pre-commit.com/
165164
[semantic-release]: https://github.com/semantic-release/semantic-release
166-
[semantic-versioning]: https://semver.org/
167165
[semantic-release documentation]: https://semantic-release.gitbook.io/semantic-release/usage/configuration#branches
166+
[semantic-versioning]: https://semver.org/
167+
[task]: https://github.com/go-task/task
168+
[uv]: https://github.com/astral-sh/uv

mkdocs.yaml

Lines changed: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,81 @@
11
# schema: https://squidfunk.github.io/mkdocs-material/schema.json
2-
32
site_name: browsr
43
nav:
5-
- browsr 🗂️: index.md
6-
- Command Line Interface ⌨️: cli.md
7-
- Contributing 🤝: contributing.md
8-
- API Documentation 🤖: reference/
4+
- browsr 🗂️: index.md
5+
- Command Line Interface ⌨️: cli.md
6+
- Contributing 🤝: contributing.md
7+
- API Documentation 🤖: reference/
98
theme:
10-
favicon: https://raw.githubusercontent.com/juftin/browsr/main/docs/_static/browsr_no_label.png
11-
logo: https://raw.githubusercontent.com/juftin/browsr/main/docs/_static/browsr_no_label.png
12-
name: material
13-
features:
14-
- navigation.tracking
15-
- content.code.annotate
16-
- content.code.copy
17-
- navigation.indexes
18-
palette:
19-
- media: "(prefers-color-scheme: light)"
20-
scheme: default
21-
accent: purple
22-
toggle:
23-
icon: material/weather-sunny
24-
name: Switch to dark mode
25-
- media: "(prefers-color-scheme: dark)"
26-
scheme: slate
27-
primary: black
28-
toggle:
29-
icon: material/weather-night
30-
name: Switch to light mode
9+
favicon: https://raw.githubusercontent.com/juftin/browsr/main/docs/_static/browsr_no_label.png
10+
logo: https://raw.githubusercontent.com/juftin/browsr/main/docs/_static/browsr_no_label.png
11+
name: material
12+
features:
13+
- navigation.tracking
14+
- content.code.annotate
15+
- content.code.copy
16+
- navigation.indexes
17+
palette:
18+
- media: "(prefers-color-scheme: light)"
19+
scheme: default
20+
accent: purple
21+
toggle:
22+
icon: material/weather-sunny
23+
name: Switch to dark mode
24+
- media: "(prefers-color-scheme: dark)"
25+
scheme: slate
26+
primary: black
27+
toggle:
28+
icon: material/weather-night
29+
name: Switch to light mode
3130
repo_url: https://github.com/juftin/browsr
3231
repo_name: browsr
3332
edit_uri: blob/main/docs/
3433
site_author: Justin Flannery
3534
remote_branch: gh-pages
3635
copyright: Copyright © 2023 Justin Flannery
3736
extra:
38-
generator: false
37+
generator: false
3938
exclude_docs: |
40-
gen_pages.py
39+
gen_pages.py
4140
markdown_extensions:
42-
- toc:
43-
permalink: "#"
44-
- pymdownx.snippets
45-
- pymdownx.magiclink
46-
- attr_list
47-
- md_in_html
48-
- pymdownx.highlight:
49-
anchor_linenums: true
50-
- pymdownx.inlinehilite
51-
- pymdownx.superfences
52-
- markdown.extensions.attr_list
53-
- pymdownx.keys
54-
- pymdownx.tasklist
55-
- pymdownx.tilde
56-
- callouts
57-
- pymdownx.details
58-
- mkdocs-click
59-
- pymdownx.emoji
60-
- pymdownx.tabbed:
61-
alternate_style: true
41+
- toc:
42+
permalink: "#"
43+
- pymdownx.snippets
44+
- pymdownx.magiclink
45+
- sane_lists
46+
- attr_list
47+
- md_in_html
48+
- pymdownx.highlight:
49+
anchor_linenums: true
50+
- pymdownx.inlinehilite
51+
- pymdownx.superfences
52+
- markdown.extensions.attr_list
53+
- pymdownx.keys
54+
- pymdownx.tasklist
55+
- pymdownx.tilde
56+
- callouts
57+
- pymdownx.details
58+
- mkdocs-click
59+
- pymdownx.emoji
60+
- pymdownx.tabbed:
61+
alternate_style: true
6262
plugins:
63-
- search
64-
- markdown-exec
65-
- autorefs
66-
- gen-files:
67-
scripts:
68-
- docs/gen_ref_pages.py
69-
- literate-nav:
70-
nav_file: SUMMARY.md
71-
- section-index:
72-
- mkdocstrings:
73-
handlers:
74-
python:
75-
import:
76-
- https://docs.python.org/3/objects.inv
77-
- https://numpy.org/doc/stable/objects.inv
78-
- https://pandas.pydata.org/docs/objects.inv
79-
options:
80-
docstring_style: numpy
81-
filters: []
63+
- search
64+
- markdown-exec
65+
- autorefs
66+
- gen-files:
67+
scripts:
68+
- docs/gen_ref_pages.py
69+
- literate-nav:
70+
nav_file: SUMMARY.md
71+
- section-index:
72+
- mkdocstrings:
73+
handlers:
74+
python:
75+
import:
76+
- https://docs.python.org/3/objects.inv
77+
- https://numpy.org/doc/stable/objects.inv
78+
- https://pandas.pydata.org/docs/objects.inv
79+
options:
80+
docstring_style: numpy
81+
filters: []

0 commit comments

Comments
 (0)