Skip to content

Commit ba2fd04

Browse files
Add a markdown linter and formatter for development (#1472)
1 parent ff97e29 commit ba2fd04

14 files changed

Lines changed: 55 additions & 38 deletions

File tree

.agents/skills/github-actions-update/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ These are in `.github/workflows/`.
1515

1616
Avoid redundant glob patterns. For in this example:
1717

18-
```
18+
```yaml
1919
on:
2020
push:
2121
paths-ignore:

.agents/skills/usethis-qa-import-linter/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ uv run lint-imports
2121

2222
## Configuration File
2323

24-
This project uses the `.importlinter` INI file to configure Import Linter. You specify _contracts_ which need to be complied with between modules' imports. For the `usethis` project, we mainly use the `layers` contract: earlier listed "higher" layers are not allowed to import from any "lower" layers.
24+
This project uses the `.importlinter` INI file to configure Import Linter. You specify _contracts_ which need to be complied with between modules' imports. For the `usethis` project, we mainly use the `layers` contract: earlier listed "higher" layers are not allowed to import from any "lower" layers.
2525

2626
### Example Structure
2727

.agents/skills/usethis-qa-static-checks/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ uv run basedpyright
1818
1919
Note that we are interested in both errors and warnings from these tools - we should always fix both.
2020
21-
## When to run these checks:
21+
## When to run these checks
2222
2323
Before submitting changes for review, **always** run these static checks. This should be done every time, even for small changes, to avoid slowing down the code review process unnecessarily.

.github/ISSUE_TEMPLATE/bug-report.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Bug Report
33
about: Describe a bug or anything else that seems wrong
4-
title: ''
5-
labels: 'bug'
4+
title: ""
5+
labels: "bug"
66
assignees: nathanjmcdougall
7-
87
---
98

109
**Background**

.github/ISSUE_TEMPLATE/enhancement.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
---
22
name: Enhancement Request
33
about: A high-level description of a feature or other enhancement you'd like
4-
title: ''
5-
labels: ''
4+
title: ""
5+
labels: ""
66
assignees: nathanjmcdougall
7-
87
---
98

109
**Motivation**

.markdownlint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
line-length:
2+
line_length: 999 # Effectively soft-wrapping
3+
no-inline-html: false
4+
no-duplicate-heading: false

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ repos:
5252
priority: 0
5353
- id: ruff-format
5454
priority: 0
55+
- repo: https://github.com/DavidAnson/markdownlint-cli2
56+
rev: v0.22.0
57+
hooks:
58+
- id: markdownlint-cli2
59+
args: ["--fix"]
60+
priority: 0
61+
- repo: https://github.com/rbubley/mirrors-prettier
62+
rev: v3.8.1
63+
hooks:
64+
- id: prettier
65+
types_or: [markdown]
66+
priority: 0
5567
- repo: https://github.com/codespell-project/codespell
5668
rev: v2.4.1
5769
hooks:

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@
497497
### 🚀 New Features
498498

499499
- The Ruff linter and formatter can now be configured independently. When using the `usethis tool ruff` command, you can now specify whether to add or remove the linter or formatter independently using the `--linter` and `--formatter` options. This allows for more granular control over which components of Ruff are used in your project. By default, as before, both the linter and formatter will be added or removed together.
500-
This introduces a change in the way that Bitbucket Pipelines steps will be configured for Ruff, by having the linter and formatter as separate steps.
500+
This introduces a change in the way that Bitbucket Pipelines steps will be configured for Ruff, by having the linter and formatter as separate steps.
501501

502502
- Integrations with Ruff for pre-commit and Bitbucket Pipelines will determine whether the linter or formatter is being used based on the presence of the `ruff.lint` and `ruff.format` keys the active Ruff configuration file.
503503

@@ -541,7 +541,7 @@ This introduces a change in the way that Bitbucket Pipelines steps will be confi
541541

542542
- The `--quiet` option did not properly suppress output when displaying warnings associated with failed README parsing in `usethis badge`. This has been fixed.
543543

544-
- Due to a breaking change in Click v8.2.0, Click is now declared as a direct dependency temporarily until the ramifications can be addressed in Typer. The lower bound is declared as `>=8.0.0` and the constraint `!=8.2.0` to avoid the breaking change. For more information, see [here](https://github.com/fastapi/typer/discussions/1215).
544+
- Due to a breaking change in Click v8.2.0, Click is now declared as a direct dependency temporarily until the ramifications can be addressed in Typer. The lower bound is declared as `>=8.0.0` and the constraint `!=8.2.0` to avoid the breaking change. For more information, see [this discussion on the Typer GitHub repository](https://github.com/fastapi/typer/discussions/1215).
545545

546546
### 🧹 Maintenance
547547

CODE_OF_CONDUCT.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
1717
Examples of behavior that contributes to a positive environment for our
1818
community include:
1919

20-
* Demonstrating empathy and kindness toward other people
21-
* Being respectful of differing opinions, viewpoints, and experiences
22-
* Giving and gracefully accepting constructive feedback
23-
* Accepting responsibility and apologizing to those affected by our mistakes,
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
2424
and learning from the experience
25-
* Focusing on what is best not just for us as individuals, but for the
25+
- Focusing on what is best not just for us as individuals, but for the
2626
overall community
2727

2828
Examples of unacceptable behavior include:
2929

30-
* The use of sexualized language or imagery, and sexual attention or
30+
- The use of sexualized language or imagery, and sexual attention or
3131
advances of any kind
32-
* Trolling, insulting or derogatory comments, and personal or political attacks
33-
* Public or private harassment
34-
* Publishing others' private information, such as a physical or email
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
3535
address, without their explicit permission
36-
* Other conduct which could reasonably be considered inappropriate in a
36+
- Other conduct which could reasonably be considered inappropriate in a
3737
professional setting
3838

3939
## Enforcement Responsibilities
@@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
106106
### 4. Permanent Ban
107107

108108
**Community Impact**: Demonstrating a pattern of violation of community
109-
standards, including sustained inappropriate behavior, harassment of an
109+
standards, including sustained inappropriate behavior, harassment of an
110110
individual, or aggression toward or disparagement of classes of individuals.
111111

112112
**Consequence**: A permanent ban from any sort of public interaction within
@@ -116,13 +116,13 @@ the community.
116116

117117
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118118
version 2.0, available at
119-
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
119+
<https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.
120120

121121
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122122
enforcement ladder](https://github.com/mozilla/diversity).
123123

124124
[homepage]: https://www.contributor-covenant.org
125125

126126
For answers to common questions about this code of conduct, see the FAQ at
127-
https://www.contributor-covenant.org/faq. Translations are available at
128-
https://www.contributor-covenant.org/translations.
127+
<https://www.contributor-covenant.org/faq>. Translations are available at
128+
<https://www.contributor-covenant.org/translations>.

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ Along with the fonts [EB Garamond](https://fonts.google.com/specimen/EB+Garamond
116116

117117
To add a new `usethis badge` interface, follow these steps:
118118

119-
- Define a `get_<badge_name>_badge` function in <src\usethis\_core\badge.py>. Try to keep the definitions in alphabetical order.
120-
- Declare the interface in <src\usethis\_ui\interface\badge.py>. Again, keep the declarations in alphabetical order. The pattern is basically just boilerplate with the other interfaces, but you need to give a description of your command for the `--help` option.
121-
- Add a test for your badge in <tests\usethis\_ui\interface\test_interface_badge.py>. Follow the pattern of the existing tests, although you only need the `test_add` case, which simply tests that the command runs without error.
122-
- Declare a recommended badge placement in the `get_badge_order` function in <src\usethis\_core\badge.py>. This helps ensure the badges are arranged in an opinionated way relative to existing badges.
119+
- Define a `get_<badge_name>_badge` function in <src\usethis_core\badge.py>. Try to keep the definitions in alphabetical order.
120+
- Declare the interface in <src\usethis_ui\interface\badge.py>. Again, keep the declarations in alphabetical order. The pattern is basically just boilerplate with the other interfaces, but you need to give a description of your command for the `--help` option.
121+
- Add a test for your badge in <tests\usethis_ui\interface\test_interface_badge.py>. Follow the pattern of the existing tests, although you only need the `test_add` case, which simply tests that the command runs without error.
122+
- Declare a recommended badge placement in the `get_badge_order` function in <src\usethis_core\badge.py>. This helps ensure the badges are arranged in an opinionated way relative to existing badges.
123123

124124
Finally, run the command on this project, to make sure the badge gets inserted correctly with valid Markdown syntax. Check it renders successfully and that any hyperlink works as expected.
125125

0 commit comments

Comments
 (0)