Commit Graph

597 Commits

Author SHA1 Message Date
Charlie Marsh 0ead9a16ac
Bump version to 0.0.278 (#5714) 2023-07-12 12:39:56 -04:00
Dhruv Manilawala 93bfa239b7
Add Jupyter Notebook usage with `pre-commit` in docs (#5666)
Similar to https://github.com/astral-sh/ruff-pre-commit/pull/45
2023-07-11 00:47:05 +05:30
Charlie Marsh c9d7c0d7d5
Add a link to the nursery; tweak icons (#5637)
## Summary

We now always render the icons, but very faintly if inactive, and always
right-align. This ensures consistent alignment as you scroll down the
page:

<img width="1792" alt="Screen Shot 2023-07-09 at 10 45 50 PM"
src="https://github.com/astral-sh/ruff/assets/1309177/da47ac0e-d646-49e1-bbe1-9f43adf94bb4">
2023-07-10 03:09:08 +00:00
Charlie Marsh eb69fe37bf
Render full-width tables in rules reference (#5636) 2023-07-10 02:39:07 +00:00
Charlie Marsh ea270da289
Move some MkDocs responsibilities around (#5542)
## Summary

Note that I've also changed from `mkdocs serve` to `mkdocs serve -f
mkdocs.generated.yml` to be clearer that this is a generated file.
2023-07-05 22:06:01 +00:00
Charlie Marsh 1a2e444799
Use Insiders version of `mkdocs-material` (#5540)
## Summary

This PR migrates our `mkdocs-material` version to
[Insiders](https://squidfunk.github.io/mkdocs-material/insiders/), which
we can access now that we're sponsors.

We can't allow public access to the Insiders version, so we instead have
a private fork, which contains a deploy key that I've added as a
read-only Actions secret in this repo. (That is: the deploy key only
lets you read that one repo, and do nothing else.)

In general, non-Astral contributors can use the non-insiders version,
and everything is expected to "work", but without the insiders features
(they're intended to be ignored). See:
https://squidfunk.github.io/mkdocs-material/insiders/#compatibility.
2023-07-05 20:36:26 +00:00
Charlie Marsh 324455f580
Bump version to 0.0.277 (#5515) 2023-07-04 17:31:32 -04:00
Aarni Koskela d7214e77e6
Add `ruff rule --all` subcommand (with JSON output) (#5059)
## Summary

This adds a `ruff rule --all` switch that prints out a human-readable
Markdown or a machine-readable JSON document of the lint rules known to
Ruff.

I needed a machine-readable document of the rules [for a
project](https://github.com/astral-sh/ruff/discussions/5078), and
figured it could be useful for other people – or tooling! – to be able
to interrogate Ruff about its arcane knowledge.

The JSON output is an array of the same objects printed by `ruff rule
--format=json`.

## Test Plan

I ran `ruff rule --all --format=json`. I think more might be needed, but
maybe a snapshot test is overkill?
2023-07-04 19:45:38 +00:00
Charlie Marsh 3992c47c00
Bump version to 0.0.276 (#5488) 2023-07-03 18:02:49 +00:00
Eric H 139a9f757b
Update default configuration.md to mention C901 rule (#5397) 2023-06-28 21:22:16 +00:00
Dhruv Manilawala d19324df69
Add Jupyter integration to the docs (#5403)
## Summary

Add Jupyter integration to the docs, specifically the Configuration and
FAQ sections.

## Test Plan

`mkdocs serve` and check that the new sections are visible and
functional.

fixes: #5396
2023-06-28 00:27:24 +00:00
Charlie Marsh 50f0edd2cb
Add dark- and light-mode image modifiers for custom MkDocs themes (#5318)
## Summary

Roughly following the docs
[here](https://squidfunk.github.io/mkdocs-material/reference/images/#custom-light-scheme).

Closes #5311.
2023-06-22 16:11:38 -04:00
Charlie Marsh 8bc7378002
Add `PythonVersion::Py312` (#5316)
Closes #5310.
2023-06-22 20:01:07 +00:00
Charlie Marsh 5dd00b19e6
Remove off-palette colors from code (#5305) 2023-06-22 16:31:22 +00:00
Charlie Marsh 3238a6ef1f
Fix 'our' to 'your' typo (#5303) 2023-06-22 15:58:24 +00:00
Charlie Marsh 96ecfae1c5
Remove off-palette colors (#5302) 2023-06-22 15:52:03 +00:00
trag1c e8ebe0a425
Update docs to match updated logo and color palette (#5283)
![8511](https://github.com/astral-sh/ruff/assets/77130613/862d151f-ff1d-4da8-9230-8dd32f41f197)

## Summary

Supersedes #5277, includes redesigned dark mode.

## Test Plan

* `python scripts/generate_mkdocs.py`
* `mkdocs serve`
2023-06-22 11:19:34 -04:00
Charlie Marsh 1c0a3a467f
Bump version to 0.0.275 (#5276) 2023-06-21 21:53:37 -04:00
Charlie Marsh e0339b538b
Bump version to 0.0.274 (#5230) 2023-06-20 22:12:32 -04:00
Charlie Marsh fde5dbc9aa
Bump version to 0.0.273 (#5218) 2023-06-20 14:37:28 -04:00
Dhruv Manilawala 6f7d3cc798
Add option (`-o`/`--output-file`) to write output to a file (#4950)
## Summary

A new CLI option (`-o`/`--output-file`) to write output to a file
instead of stdout.

Major change is to remove the lock acquired on stdout. The argument is
that the output is buffered and thus the lock is acquired only when
writing a block (8kb). As per the benchmark below there is a slight
performance penalty.

Reference:
https://rustmagazine.org/issue-3/javascript-compiler/#printing-is-slow

## Benchmarks

_Output is truncated to only contain useful information:_

Command: `check --isolated --no-cache --select=ALL --show-source
./test-repos/cpython"`

Latest HEAD (361d45f2b2) with and without
the manual lock on stdout:

```console
Benchmark 1: With lock
  Time (mean ± σ):      5.687 s ±  0.075 s    [User: 17.110 s, System: 0.486 s]
  Range (min … max):    5.615 s …  5.860 s    10 runs

Benchmark 2: Without lock
  Time (mean ± σ):      5.719 s ±  0.064 s    [User: 17.095 s, System: 0.491 s]
  Range (min … max):    5.640 s …  5.865 s    10 runs

Summary
  (1) ran 1.01 ± 0.02 times faster than (2)
```

This PR:

```console
Benchmark 1: This PR
  Time (mean ± σ):      5.855 s ±  0.058 s    [User: 17.197 s, System: 0.491 s]
  Range (min … max):    5.786 s …  5.987 s    10 runs
 
Benchmark 2: Latest HEAD with lock
  Time (mean ± σ):      5.645 s ±  0.033 s    [User: 16.922 s, System: 0.495 s]
  Range (min … max):    5.600 s …  5.712 s    10 runs
 
Summary
  (2) ran 1.04 ± 0.01 times faster than (1)
```

## Test Plan

Run all of the commands which gives output with and without the
`--output-file=ruff.out` option:
* `--show-settings`
* `--show-files`
* `--show-fixes`
* `--diff`
* `--select=ALL`
* `--select=All --show-source`
* `--watch` (only stdout allowed)

resolves: #4754
2023-06-20 22:16:49 +05:30
MT BENTERKI c1fd2c8a8e
Update tutorial doc typo (#5088) 2023-06-14 11:17:35 -04:00
Aarni Koskela 7b4dde0c6c
Add JSON Lines (NDJSON) message serialization (#5048)
## Summary

This adds `json-lines` (https://jsonlines.org/ or http://ndjson.org/) as
an output format.

I'm sure you already know, but

* JSONL is more greppable (each record is a single line) than the pretty
JSON
* JSONL is faster to ingest piecewise (and/or in parallel) than JSON

## Test Plan

Snapshot test in the new module :)
2023-06-13 14:15:55 +00:00
qdegraaf a477720f4e
[`perflint`] Add `perflint` plugin, add first rule `PERF102` (#4821)
## Summary

Adds boilerplate for implementing the
[perflint](https://github.com/tonybaloney/perflint/) plugin, plus a
first rule.

## Test Plan

Fixture added for PER8102

## Issue link

Refers: https://github.com/charliermarsh/ruff/issues/4789
2023-06-13 01:54:44 +00:00
Ryan Yang ab3c02342b
Implement copyright notice detection (#4701)
## Summary

Add copyright notice detection to enforce the presence of copyright
headers in Python files.

Configurable settings include: the relevant regular expression, the
author name, and the minimum file size, similar to
[flake8-copyright](https://github.com/savoirfairelinux/flake8-copyright).

Closes https://github.com/charliermarsh/ruff/issues/3579

---------

Signed-off-by: ryan <ryang@waabi.ai>
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2023-06-11 02:17:58 +00:00
qdegraaf 2bb32ee943
[`flake8-slots`] Add plugin, add `SLOT000`, `SLOT001` and `SLOT002` (#4909) 2023-06-09 04:14:16 +00:00
Dhruv Manilawala 07cc4bcb0f
Update links to point to Astral org (#4949) 2023-06-08 11:43:40 -04:00
Charlie Marsh 5235977abc
Bump version to 0.0.272 (#4948) 2023-06-08 02:17:29 +00:00
Charlie Marsh 2b5fb70482
Bump version to 0.0.271 (#4890) 2023-06-06 15:11:48 -04:00
Charlie Marsh f9b3f10456
Clarify that [tool.ruff] must be omitted for ruff.toml (#4732) 2023-05-30 17:35:28 +00:00
Charlie Marsh 9646bc7d7f
Add docs to clarify project root heuristics (#4697) 2023-05-29 02:50:35 +00:00
Julian LaNeve 5756829344
markdownlint: enforce 100 char max length (#4698) 2023-05-28 22:45:56 -04:00
Charlie Marsh f4572fe40b
Bump version to 0.0.270 (#4637) 2023-05-24 16:34:29 +00:00
Charlie Marsh f22c269ccf
Point LSP, VS Code, and pre-commut URLs to Astral org (#4562) 2023-05-21 15:27:35 -04:00
Felipe Peter 0a3cf8ba11
Fix typos in docs (#4540) 2023-05-20 07:23:17 -04:00
Aaron Cunningham 41a681531d
Support new `extend-per-file-ignores` setting (#4265) 2023-05-19 12:24:04 -04:00
Charlie Marsh 15cb21a6f4
Implement `--extend-fixable` option (#4297) 2023-05-18 22:20:19 -04:00
Charlie Marsh d4c0a41b00
Bump version to 0.0.269 (#4506) 2023-05-18 19:45:20 +00:00
Charlie Marsh 8702b5a40a
Bump version to 0.0.268 (#4501) 2023-05-18 15:35:46 -04:00
qdegraaf 8ba9eb83af
Implement `flake8-async` plugin (#4432) 2023-05-15 09:15:28 -04:00
Evan Rittenhouse 2f53781a77
Implement `flake8_todos` (#3921) 2023-05-13 14:19:06 +00:00
Charlie Marsh dcedd5cd9d
Bump version to 0.0.267 (#4400) 2023-05-12 19:04:56 +00:00
Charlie Marsh 67076b2dcb
Bump version to 0.0.266 (#4391) 2023-05-12 13:11:03 -04:00
Charlie Marsh 865205d992
Implement pygrep-hook's Mock-mistake diagnostic (#4366) 2023-05-11 03:26:29 +00:00
Charlie Marsh f23851130a
Add `flynt` to documentation (#4295) 2023-05-09 00:52:41 +00:00
Charlie Marsh 43d6aa9173
Clarify some docstring-related docs (#4292) 2023-05-08 22:24:53 +00:00
Calum Young cd41de2588
Check docs formatting check (#4270) 2023-05-08 19:03:22 +00:00
Jerome Leclanche 5ac2c7d293
Add .git-rewrite folder to default ignored folder paths (#4261) 2023-05-06 22:40:38 -04:00
Charlie Marsh 11e1380df4
Bump version to 0.0.265 (#4248) 2023-05-05 13:16:05 -04:00
Christian Clauss ccfc78e2d5
faq: Clarify how Ruff and Black treat line-length. (#4180) 2023-05-02 23:19:38 +00:00
Charlie Marsh 8cb76f85eb
Bump version to 0.0.264 (#4179) 2023-05-01 23:33:38 -07:00
Dhruv Manilawala b9c06b48e1
Document that `--diff` implies `--fix-only` (#4098) 2023-04-25 21:19:44 -06:00
Charlie Marsh fd7ccb4c9e
Bump version to 0.0.263 (#4086) 2023-04-24 23:32:29 -06:00
Pronoy Mandal b7a57ce120
Update tutorial.md (#4055) 2023-04-21 10:56:31 -06:00
Charlie Marsh 25a6bfa9ee
Bump version to 0.0.262 (#4032) 2023-04-19 15:49:28 -04:00
Charlie Marsh d9ed43d112
Clarify some isort differences in FAQ (#3954) 2023-04-13 04:05:28 +00:00
brucearctor 5c374b5793
Consistent Style/Levels in Usage (#3884) 2023-04-05 03:06:43 +00:00
Charlie Marsh 255b094b33
Bump version to 0.0.261 (#3881) 2023-04-04 22:31:01 -04:00
brucearctor e006b922a6
Add documentation for `ruff-action` (GitHub Action!) (#3857) 2023-04-03 23:47:26 +00:00
Charlie Marsh 9d3b8eb67b
Bump version to v0.0.260 (#3799) 2023-03-29 14:51:50 -04:00
Charlie Marsh e1e5532ab1
Add flymake-ruff to docs (#3800) 2023-03-29 18:48:59 +00:00
Charlie Marsh 5977862a60
Enumerate all codes in default configuration example (#3790) 2023-03-28 23:36:22 +00:00
Leiser Fernández Gallo 224e85c6d7
Implement `flake8-gettext` (#3785) 2023-03-28 23:32:02 +00:00
Charlie Marsh 515e436cfa
Clarify order of `pre-commit` hooks (#3789) 2023-03-28 23:15:36 +00:00
Charlie Marsh c3917eab38
Revert "Implement `flake8-i18n` (#3741)" (#3765) 2023-03-27 21:14:38 +00:00
Leiser Fernández Gallo 5cb120327c
Implement `flake8-i18n` (#3741) 2023-03-27 18:03:39 +00:00
Charlie Marsh 6a40a5c5a2
Add a note on `src` (#3733) 2023-03-25 16:18:34 +00:00
Charlie Marsh f58345dee3
Bump version to v0.0.259 (#3691) 2023-03-23 14:52:42 -04:00
Charlie Marsh 615887a7fe
Bump version to v0.0.258 (#3671) 2023-03-22 15:02:57 -04:00
Charlie Marsh 1e45b13958
Remove linked issue from `flake8-django` (#3664) 2023-03-22 03:26:22 +00:00
Rogdham f06dff8af8
Change broken links in README to beta.ruff.rs (#3607) 2023-03-19 15:17:44 +00:00
Charlie Marsh 621e4353e3
Re-add the list of supported plugins to the README (#3592) 2023-03-17 23:33:37 -04:00
Charlie Marsh 0c4926ff7b
Bump version to v0.0.257 (#3591) 2023-03-17 22:34:10 -04:00
Charlie Marsh 12dfd57211
Bump version to v0.0.256 (#3531) 2023-03-14 22:52:21 -04:00
Charlie Marsh 432059de35
Allow `# ruff:` prefix for isort action comments (#3493) 2023-03-14 14:34:28 -04:00
Charlie Marsh 106a93eab0
Make Clap an optional feature for ruff crate (#3498) 2023-03-14 11:02:05 -04:00
Charlie Marsh 62ff3b62e3
Add `requires-python` inference to docs (#3495) 2023-03-13 18:14:39 -04:00
Charlie Marsh aa97a092bd
Bump version to v0.0.255 (#3485) 2023-03-13 14:06:51 -04:00
Y.D.X 297749a3a8
[doc] Update FAQ on Flake8 for structural pattern matching (#3473) 2023-03-13 02:27:22 +00:00
StefanBRas 30c71dc59a
Add Azure Devops as a `-format` option. (#3335) 2023-03-06 02:48:39 +00:00
Charlie Marsh bbbc44336e
Bump version to 0.0.254 (#3331) 2023-03-03 19:11:07 -05:00
Charlie Marsh 187104e396
Flag out-of-date docs on CI (#3309) 2023-03-02 15:55:39 -05:00
Charlie Marsh 8066607ea3
Add a preliminary tutorial (#3281) 2023-02-28 20:31:27 +00:00
Jonathan Plasse d285f5c90a
Run automatically format code blocks with Black (#3191) 2023-02-27 10:14:05 -05:00
Charlie Marsh 386ca7c9a1
Bump version to 0.0.253 (#3245) 2023-02-26 23:10:04 -05:00
Charlie Marsh bbc55cdb04
Allow ruff.toml file to be dot-prefixed (as .ruff.toml) (#3221) 2023-02-24 23:14:26 +00:00
Charlie Marsh 2792439eac
Add TextMate to editor-integrations.md (#3219) 2023-02-24 22:57:33 +00:00
Carlos Gonçalves 1c01b3c934
fix(docs): broken links inside Configuration.md (#3205) 2023-02-24 18:55:33 +00:00
Jonathan Plasse 39b9a1637f
Fix Markdown errors in docs (#3187) 2023-02-24 13:06:48 -05:00
Jonathan Plasse 6e54cd8233
Normalize relative markdown links (#3190) 2023-02-23 16:24:31 -05:00
Charlie Marsh 48a317d5f6
Change via to using (#3155) 2023-02-23 01:47:15 +00:00
Charlie Marsh 74e18b6cff
Split up some docs sections (#3154) 2023-02-22 20:18:10 -05:00
Charlie Marsh 049e77b939
Follow-up with some small doc changes (#3152) 2023-02-23 00:35:22 +00:00
Charlie Marsh b9bfb81e36
Move configuration out of README and into permanent docs (#3150) 2023-02-22 19:25:53 -05:00
Rupert Tombs 817d0b4902
Fix =/== error in `ManualDictLookup` (#3117) 2023-02-22 15:14:30 +00:00
Charlie Marsh 37df07d2e0
Re-add compatibility to README (#3091) 2023-02-21 18:57:47 +00:00
Colin Delahunty 9545958ad8
[`flake8-simplify`]: Implement manual-dict-lookup (#2767) 2023-02-20 20:00:59 +00:00
Jonathan Plasse db4c611c6f
Fix broken links and markdown style (#3017) 2023-02-19 08:46:49 -05:00
Charlie Marsh bebd412469
Adjust header depth in docs (#2985) 2023-02-17 13:19:55 +00:00
Charlie Marsh cd1f57b713
Move FAQ into MkDocs (#2984) 2023-02-17 13:15:53 +00:00
Charlie Marsh a0912deb2b
Move editor integrations into MkDocs (#2983) 2023-02-17 13:12:20 +00:00
Nick Pope e5179f67fd
Remove autogenerated `docs/rules/*.md` files (#2917) 2023-02-15 08:11:11 -05:00
Simon Brugman ac028cd9f8
[`numpy`] deprecated type aliases (#2810)
Closes https://github.com/charliermarsh/ruff/issues/2455

Used `NPY` as prefix code as agreed in the issue.
2023-02-14 23:45:12 +00:00
Martin Fischer 02285c18d1 Remove autogenerated docs/rules/*.md files 2023-02-13 19:34:06 -05:00
Martin Fischer c858804ed4 refactor: Move docs/ gitignores to docs/.gitignore 2023-02-13 19:34:06 -05:00
Charlie Marsh 3c03e2cb2e
Rename flake8-django rules to match convention (#2861) 2023-02-13 15:30:04 +00:00
Ville Skyttä d1cf0ee52b
Remove "blanket" from RUF100 README message (#2844) 2023-02-13 14:43:35 +00:00
Florian Best 749d197119
docs(SIM114): fix typo in python code (#2833) 2023-02-12 18:35:29 -05:00
Colin Delahunty 1f07ad6e61
[`flake8-simplify`]: combine-if-conditions (#2823) 2023-02-12 21:00:32 +00:00
Charlie Marsh c399b3e6c1
Run cargo dev generate-all (#2822) 2023-02-12 19:11:49 +00:00
Martin Fischer 28c9263722 Automatically linkify option references in rule documentation
Previously the rule documentation referenced configuration options
via full https:// URLs, which was bad for several reasons:

* changing the website would mean you'd have to change all URLs
* the links didn't work when building mkdocs locally
* the URLs showed up in the `ruff rule` output
* broken references weren't detected by our CI

This commit solves all of these problems by post-processing the
Markdown, recognizing sections such as:

    ## Options

    * `flake8-tidy-imports.ban-relative-imports`

`cargo dev generate-all` will automatically linkify such references
and panic if the referenced option doesn't exist.
Note that the option can also be linked in the other Markdown sections
via e.g. [`flake8-tidy-imports.ban-relative-imports`] since
the post-processing code generates a CommonMark link definition.

Resolves #2766.
2023-02-12 13:19:11 -05:00
Zeddicus414 26f39cac2f
Add PD002 use-of-inplace-argument documentation (#2799) 2023-02-12 18:10:34 +00:00
Simon Brugman 02897a141b
[`flake8-tidy-imports`] add documentation for `banned-api` (#2819) 2023-02-12 18:09:39 +00:00
Nyakku Shigure fc465cc2af
[`flake8-pyi`]: add rules for unrecognized platform check (PYI007, PYI008) (#2805)
Add two [flake8-pyi](https://github.com/PyCQA/flake8-pyi) rules (Y007, Y008). ref: #848

The specifications are described in [PEP 484 - Version and platform checking](https://peps.python.org/pep-0484/#version-and-platform-checking)

The original implementation in flake8-pyi is shown below.

- Implemention: 66f28a4407/pyi.py (L1429-L1443)
- Tests: 66f28a4407/tests/sysplatform.pyi
2023-02-12 18:02:38 +00:00
Karol Onyśko 6769a5bce7
Implement flake8-django plugin rules (#2586) 2023-02-12 17:47:59 +00:00
Zeddicus414 fda93c6245
Add E722 bare-except documentation (#2796) 2023-02-12 16:51:32 +00:00
trag1c b8835c2e35
Added MkDocs section to CONTRIBUTING.md (#2803) 2023-02-12 16:07:24 +00:00
Simon Brugman 1d4422f004
[`flake8-comprehensions`] improve autofix for C401, C402 and C417 (#2806) 2023-02-12 16:03:37 +00:00
Simon Brugman 2dccb7611a
[`flake8-comprehensions`] bugfix for C413 autofix (#2804) 2023-02-12 15:56:07 +00:00
Simon Brugman 0123425be1
[`flake8-comprehensions`] autofix C414 and C417 + bugfix (#2693)
Closes https://github.com/charliermarsh/ruff/issues/2262 and closes https://github.com/charliermarsh/ruff/issues/2423

Fixes bug where some cases generated duplicated violations (see https://github.com/charliermarsh/ruff/pull/2732#issuecomment-1426397842)
2023-02-12 05:20:42 +00:00
Charlie Marsh 4a12ebb9b1
Improve f-string-missing-placeholders documentation (#2800) 2023-02-12 04:58:24 +00:00
Charlie Marsh 418808895e
Add docs for f-string-missing-placeholders and unused-variable (#2790) 2023-02-12 02:48:36 +00:00
Charlie Marsh 74731a3456
Fix reference to ban-relative-imports setting (#2776) 2023-02-11 18:34:25 +00:00
Martin Fischer 70ff65154d Rename function-is-too-complex to complex-structure 2023-02-11 12:05:17 -05:00
trag1c e6538a7969
Added logo and favicon for mkdocs (#2757) 2023-02-10 23:34:47 -05:00
Charlie Marsh 9fd29e2c54 Mention default in relative-imports doc 2023-02-10 22:12:22 -05:00
Simon Brugman e83ed0ecba
Implement autofix for relative imports (TID252) (#2739) 2023-02-10 22:05:47 -05:00
Nick Pope 9f84c497f9
Adjust heading level in rule documentation (#2749) 2023-02-10 19:10:42 -05:00
Martin Fischer 0ec25d1514
Rename dynamically-typed-expression to any-type (#2751) 2023-02-10 19:02:31 -05:00
Charlie Marsh c8f60c9588 Improve implicit-namespace-package documentation 2023-02-10 18:06:48 -05:00
Charlie Marsh 113610a8d4 Improve hardcoded-sql-expression documentation 2023-02-10 18:03:01 -05:00
Charlie Marsh 6376e5915e Improve dynamically-typed-expression documentation 2023-02-10 17:55:26 -05:00
Charlie Marsh 3d8fb5be20
Rewrite documentation for yield-in-init (#2748) 2023-02-10 17:49:55 -05:00
Charlie Marsh e5f5142e3e Improve yield-in-init documentation 2023-02-10 16:47:44 -05:00
Charlie Marsh 98d5ffb817 Fix __init__.py-to-__init__ in documentation 2023-02-10 16:30:36 -05:00
Charlie Marsh 3f20f73413
Use `function_type::classify` for `yield-in-init` (#2742) 2023-02-10 16:19:45 -05:00
Martin Fischer ec63658250 Disallow rule names starting with avoid-* 2023-02-10 09:25:29 -05:00
Colin Delahunty 48daa0f0ca
[`pylint`]: bad-string-format-type (#2572) 2023-02-09 20:08:56 -05:00
Matt Oberle fc628de667
Implement bandit's 'hardcoded-sql-expressions' S608 (#2698)
This is an attempt to implement `bandit` rule `B608` (renamed here `S608`).
- https://bandit.readthedocs.io/en/latest/plugins/b608_hardcoded_sql_expressions.html

The rule inspects strings constructed via `+`, `%`, `.format`, and `f""`.

- `+` and `%` via `BinOp`
- `.format` via `Call`
- `f""` via `JoinedString`

Any SQL-ish strings that use Python string formatting are flagged.

The expressions and targeted expression types for the rule come from here:
- 7104b336d3/bandit/plugins/injection_sql.py

> Related Issue: https://github.com/charliermarsh/ruff/issues/1646
2023-02-09 19:28:17 -05:00
Steve Dignam 67e58a024a
Add flake8-pyi with one rule (#2682)
Add basic scaffold for [flake8-pyi](https://github.com/PyCQA/flake8-pyi) and the first rule, Y001

rel: https://github.com/charliermarsh/ruff/issues/848
2023-02-09 19:03:11 -05:00
Nick Pope 7750087f56
Remove duplicate documentation for `TRY002` (#2692) 2023-02-09 12:08:00 -05:00
Charlie Marsh 7d5fb0de8a
Add documentation for mccabe, isort, and flake8-annotations (#2691) 2023-02-09 11:56:18 -05:00
Nuno Mendes 9cd1bf9c03
doc: add documentation for TRY002 (#2655) 2023-02-08 11:04:31 -05:00
Charlie Marsh 4c35feaa18
Add documentation for eradicate, flake8-import-conventions, and flake8-no-pep420 (#2652) 2023-02-07 22:19:21 -05:00
Charlie Marsh a9aa96b24f
Add documentation for flake8-quotes rules (#2650) 2023-02-07 21:20:24 -05:00
Charlie Marsh 56398e0002
Tweak format for rule explanations (#2645) 2023-02-07 19:02:41 -05:00
Charlie Marsh 271e4fda8c
Create per-rule pages and link from README (#2644) 2023-02-07 18:15:05 -05:00