mirror of https://github.com/astral-sh/ruff
Fix broken links and markdown style (#3017)
This commit is contained in:
parent
c25be31eb1
commit
db4c611c6f
|
|
@ -1,3 +1,4 @@
|
||||||
|
fail_fast: true
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/abravalheri/validate-pyproject
|
- repo: https://github.com/abravalheri/validate-pyproject
|
||||||
rev: v0.10.1
|
rev: v0.10.1
|
||||||
|
|
@ -12,6 +13,7 @@ repos:
|
||||||
- --disable
|
- --disable
|
||||||
- MD013 # line-length
|
- MD013 # line-length
|
||||||
- MD033 # no-inline-html
|
- MD033 # no-inline-html
|
||||||
|
- MD041 # first-line-h1
|
||||||
- --
|
- --
|
||||||
|
|
||||||
- repo: local
|
- repo: local
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
# Contributor Covenant Code of Conduct
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
- [Our Pledge](#our-pledge)
|
* [Our Pledge](#our-pledge)
|
||||||
- [Our Standards](#our-standards)
|
* [Our Standards](#our-standards)
|
||||||
- [Enforcement Responsibilities](#enforcement-responsibilities)
|
* [Enforcement Responsibilities](#enforcement-responsibilities)
|
||||||
- [Scope](#scope)
|
* [Scope](#scope)
|
||||||
- [Enforcement](#enforcement)
|
* [Enforcement](#enforcement)
|
||||||
- [Enforcement Guidelines](#enforcement-guidelines)
|
* [Enforcement Guidelines](#enforcement-guidelines)
|
||||||
- [1. Correction](#1-correction)
|
* [1. Correction](#1-correction)
|
||||||
- [2. Warning](#2-warning)
|
* [2. Warning](#2-warning)
|
||||||
- [3. Temporary Ban](#3-temporary-ban)
|
* [3. Temporary Ban](#3-temporary-ban)
|
||||||
- [4. Permanent Ban](#4-permanent-ban)
|
* [4. Permanent Ban](#4-permanent-ban)
|
||||||
- [Attribution](#attribution)
|
* [Attribution](#attribution)
|
||||||
|
|
||||||
## Our Pledge
|
## Our Pledge
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,16 @@
|
||||||
|
|
||||||
Welcome! We're happy to have you here. Thank you in advance for your contribution to Ruff.
|
Welcome! We're happy to have you here. Thank you in advance for your contribution to Ruff.
|
||||||
|
|
||||||
- [The Basics](#the-basics)
|
* [The Basics](#the-basics)
|
||||||
- [Prerequisites](#prerequisites)
|
* [Prerequisites](#prerequisites)
|
||||||
- [Development](#development)
|
* [Development](#development)
|
||||||
- [Project Structure](#project-structure)
|
* [Project Structure](#project-structure)
|
||||||
- [Example: Adding a new lint rule](#example-adding-a-new-lint-rule)
|
* [Example: Adding a new lint rule](#example-adding-a-new-lint-rule)
|
||||||
- [Rule naming convention](#rule-naming-convention)
|
* [Rule naming convention](#rule-naming-convention)
|
||||||
- [Example: Adding a new configuration option](#example-adding-a-new-configuration-option)
|
* [Example: Adding a new configuration option](#example-adding-a-new-configuration-option)
|
||||||
- [MkDocs](#mkdocs)
|
* [MkDocs](#mkdocs)
|
||||||
- [Release Process](#release-process)
|
* [Release Process](#release-process)
|
||||||
- [Benchmarks](#benchmarks)
|
* [Benchmarks](#benchmarks)
|
||||||
|
|
||||||
## The Basics
|
## The Basics
|
||||||
|
|
||||||
|
|
@ -94,12 +94,12 @@ The vast majority of the code, including all lint rules, lives in the `ruff` cra
|
||||||
|
|
||||||
At time of writing, the repository includes the following crates:
|
At time of writing, the repository includes the following crates:
|
||||||
|
|
||||||
- `crates/ruff`: library crate containing all lint rules and the core logic for running them.
|
* `crates/ruff`: library crate containing all lint rules and the core logic for running them.
|
||||||
- `crates/ruff_cli`: binary crate containing Ruff's command-line interface.
|
* `crates/ruff_cli`: binary crate containing Ruff's command-line interface.
|
||||||
- `crates/ruff_dev`: binary crate containing utilities used in the development of Ruff itself (e.g., `cargo dev generate-all`).
|
* `crates/ruff_dev`: binary crate containing utilities used in the development of Ruff itself (e.g., `cargo dev generate-all`).
|
||||||
- `crates/ruff_macros`: library crate containing macros used by Ruff.
|
* `crates/ruff_macros`: library crate containing macros used by Ruff.
|
||||||
- `crates/ruff_python`: library crate implementing Python-specific functionality (e.g., lists of standard library modules by versionb).
|
* `crates/ruff_python`: library crate implementing Python-specific functionality (e.g., lists of standard library modules by versionb).
|
||||||
- `crates/flake8_to_ruff`: binary crate for generating Ruff configuration from Flake8 configuration.
|
* `crates/flake8_to_ruff`: binary crate for generating Ruff configuration from Flake8 configuration.
|
||||||
|
|
||||||
### Example: Adding a new lint rule
|
### Example: Adding a new lint rule
|
||||||
|
|
||||||
|
|
@ -146,7 +146,7 @@ Finally, regenerate the documentation and generated code with `cargo dev generat
|
||||||
|
|
||||||
#### Rule naming convention
|
#### Rule naming convention
|
||||||
|
|
||||||
The rule name should make sense when read as "allow *rule-name*" or "allow *rule-name* items".
|
The rule name should make sense when read as "allow _rule-name_" or "allow _rule-name_ items".
|
||||||
|
|
||||||
This implies that rule names:
|
This implies that rule names:
|
||||||
|
|
||||||
|
|
@ -186,14 +186,19 @@ Finally, regenerate the documentation and generated code with `cargo dev generat
|
||||||
To preview any changes to the documentation locally:
|
To preview any changes to the documentation locally:
|
||||||
|
|
||||||
1. Install MkDocs and Material for MkDocs with:
|
1. Install MkDocs and Material for MkDocs with:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
pip install -r docs/requirements.txt
|
pip install -r docs/requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Generate the MkDocs site with:
|
2. Generate the MkDocs site with:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
python scripts/generate_mkdocs.py
|
python scripts/generate_mkdocs.py
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Run the development server with:
|
3. Run the development server with:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
mkdocs serve
|
mkdocs serve
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -172,8 +172,8 @@ Ruff can lint code for any Python version from 3.7 onwards. However, Ruff lacks
|
||||||
language features that were introduced in Python 3.10 and later. Specifically, Ruff does not
|
language features that were introduced in Python 3.10 and later. Specifically, Ruff does not
|
||||||
support:
|
support:
|
||||||
|
|
||||||
- "Structural Pattern Matching" ([PEP 622](https://peps.python.org/pep-0622/)), introduced in Python 3.10.
|
* "Structural Pattern Matching" ([PEP 622](https://peps.python.org/pep-0622/)), introduced in Python 3.10.
|
||||||
- "Exception Groups and except* ([PEP 654](https://www.python.org/dev/peps/pep-0654/)), introduced in Python 3.11.
|
* "Exception Groups and except* ([PEP 654](https://www.python.org/dev/peps/pep-0654/)), introduced in Python 3.11.
|
||||||
|
|
||||||
Support for these features is planned.
|
Support for these features is planned.
|
||||||
|
|
||||||
|
|
@ -208,7 +208,7 @@ and in how Ruff and isort treat inline comments in some cases (see: [#1381](http
|
||||||
Like isort, Ruff's import sorting is compatible with Black.
|
Like isort, Ruff's import sorting is compatible with Black.
|
||||||
|
|
||||||
Ruff does not yet support all of isort's configuration options, though it does support many of
|
Ruff does not yet support all of isort's configuration options, though it does support many of
|
||||||
them. You can find the supported settings in the [API reference](#isort). For example, you can set
|
them. You can find the supported settings in the [API reference](https://beta.ruff.rs/docs/settings/#isort). For example, you can set
|
||||||
`known-first-party` like so:
|
`known-first-party` like so:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
|
|
@ -324,7 +324,7 @@ have _complete_ certainty when making changes to code, even for the seemingly tr
|
||||||
In the future, Ruff will support enabling autofix behavior based on the safety of the patch.
|
In the future, Ruff will support enabling autofix behavior based on the safety of the patch.
|
||||||
|
|
||||||
In the meantime, if you find that the autofix is too aggressive, you can disable it on a per-rule or
|
In the meantime, if you find that the autofix is too aggressive, you can disable it on a per-rule or
|
||||||
per-category basis using the [`unfixable`](#unfixable) mechanic. For example, to disable autofix
|
per-category basis using the [`unfixable`](https://beta.ruff.rs/docs/settings/#unfixable) mechanic. For example, to disable autofix
|
||||||
for some possibly-unsafe rules, you could add the following to your `pyproject.toml`:
|
for some possibly-unsafe rules, you could add the following to your `pyproject.toml`:
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue