Commit Graph

795 Commits

Author SHA1 Message Date
Charlie Marsh 2b5fb70482
Bump version to 0.0.271 (#4890) 2023-06-06 15:11:48 -04:00
Micha Reiser 33434fcb9c
Add Formatter benchmark (#4860) 2023-06-05 21:05:42 +02:00
Zanie Adkins 5ae4667fd5
Upgrade `criterion` to `0.5.1` (#4838) 2023-06-03 21:33:44 +01:00
Charlie Marsh b8f45c93b4
Use a separate fix-isolation group for every parent node (#4774) 2023-06-02 03:07:55 +00:00
Charlie Marsh 621718784a
Replace deletion-tracking with enforced isolation levels (#4766) 2023-06-02 02:45:56 +00:00
konstin d4027d8b65
Use new formatter infrastructure in CLI and test (#4767)
* Use dummy verbatim formatter for all nodes

* Use new formatter infrastructure in CLI and test

* Expose the new formatter in the CLI

* Merge import blocks
2023-06-01 11:55:04 +02:00
Charlie Marsh 399eb84d5e
Add a `ruff_textwrap` crate (#4731) 2023-05-31 16:35:23 +00:00
Charlie Marsh 9d0ffd33ca
Move universal newline handling into its own crate (#4729) 2023-05-31 12:00:47 -04:00
Micha Reiser 6c1ff6a85f
Upgrade RustPython (#4747) 2023-05-31 08:26:35 +00:00
Charlie Marsh a4f73ea8c7
Remove unused `getrandom` dependency (#4734) 2023-05-30 14:34:20 -04:00
Charlie Marsh ea31229be0
Track `TYPE_CHECKING` blocks in `Importer` (#4593) 2023-05-30 16:18:10 +00:00
Micha Reiser 0cd453bdf0
Generic "comment to node" association logic (#4642) 2023-05-30 09:28:01 +00:00
Micha Reiser 6146b75dd0
Add `MultiMap` implementation for storing comments (#4639) 2023-05-30 09:51:25 +02:00
Micha Reiser 33a7ed058f
Create `PreorderVisitor` trait (#4658) 2023-05-26 06:14:08 +00:00
konstin b6a382eeaf
Lint pyproject.toml (#4496)
This adds a new rule `InvalidPyprojectToml` that lints pyproject.toml by checking if https://github.com/PyO3/pyproject-toml-rs can parse it. This means the linting is currently very basic, e.g. we don't check whether the name is actually a valid python project name or appropriately normalized. It does catch errors e.g. with invalid dependency requirements or problems withs the license specifications. It is open to be extended in the future (validate name, SPDX expressions, classifiers, ...), either in ruff or in pyproject-toml-rs.

Test plan:

```
scripts/ecosystem_all_check.sh check --select RUF200
```
This lead to a bunch of 
```
RUF200 Failed to parse pyproject.toml: missing field `name`
```
(e.g. https://github.com/amitsk/fastapi-todos/blob/main/pyproject.toml) which is indeed invalid (https://packaging.python.org/en/latest/specifications/declaring-project-metadata/#specification).

Filtering those out, the following other problems were found by `cd target/ecosystem_all_results/ && rg RUF200`:
```
UCL-ARC:rred-reports.stdout.txt
1:pyproject.toml:27:16: RUF200 Failed to parse pyproject.toml: Version specifier `>='3.9'` doesn't match PEP 440 rules
EndlessTrax:python-start-project.stdout.txt
1:pyproject.toml:14:16: RUF200 Failed to parse pyproject.toml: Expected package name starting with an alphanumeric character, found '#'
redjax:gardening-api.stdout.txt
1:pyproject.toml:7:11: RUF200 Failed to parse pyproject.toml: Version `` doesn't match PEP 440 rules
ajslater:codex.stdout.txt
2:  3:17 RUF200 Failed to parse pyproject.toml: invalid type: sequence, expected a string
LDmitriy7:404_AvatarsBot.stdout.txt
1:pyproject.toml:3:11: RUF200 Failed to parse pyproject.toml: Version `` doesn't match PEP 440 rules
ajslater:comicbox.stdout.txt
1:pyproject.toml:3:17: RUF200 Failed to parse pyproject.toml: invalid type: sequence, expected a string
manueldevillena:forecast-earnings.stdout.txt
1:pyproject.toml:24:12: RUF200 Failed to parse pyproject.toml: Expected one of `@`, `(`, `<`, `=`, `>`, `~`, `!`, `;`, found `^`
redjax:ohio_utility_scraper.stdout.txt
1:pyproject.toml:11:11: RUF200 Failed to parse pyproject.toml: Version `` doesn't match PEP 440 rules
agronholm:typeguard.stdout.txt
1:pyproject.toml:40:8: RUF200 Failed to parse pyproject.toml: Expected a valid marker name, found 'python_implementation'
cyuss:decathlon-turnover.stdout.txt
1:pyproject.toml:7:12: RUF200 Failed to parse pyproject.toml: invalid type: string "Youcef", expected a table with 'name' and 'email' keys
ajslater:boilerplate.stdout.txt
1:pyproject.toml:3:17: RUF200 Failed to parse pyproject.toml: invalid type: sequence, expected a string
kaparoo:lightning-project-template.stdout.txt
1:pyproject.toml:56:16: RUF200 Failed to parse pyproject.toml: You can't mix a >= operator with a local version (`+cu117`)
dijital20:pytexas2023-decorators.stdout.txt
1:pyproject.toml:5:11: RUF200 Failed to parse pyproject.toml: Version `` doesn't match PEP 440 rules
pfouque:django-anymail-history.stdout.txt
1:pyproject.toml:137:12: RUF200 Failed to parse pyproject.toml: Version specifier `> = 1.2.0` doesn't match PEP 440 rules
pfouque:django-fakemessages.stdout.txt
1:pyproject.toml:130:12: RUF200 Failed to parse pyproject.toml: Version specifier `> = 1.2.0` doesn't match PEP 440 rules
pypa:build.stdout.txt
1:tests/packages/test-invalid-requirements/pyproject.toml:2:12: RUF200 Failed to parse pyproject.toml: Expected one of `@`, `(`, `<`, `=`, `>`, `~`, `!`, `;`, found `i`
4:tests/packages/test-no-requires/pyproject.toml:1:1: RUF200 Failed to parse pyproject.toml: missing field `requires`
UnoYakshi:FRAAND.stdout.txt
2:  3:11 RUF200 Failed to parse pyproject.toml: Version `` doesn't match PEP 440 rules
DHolmanCoding:python-template.stdout.txt
1:pyproject.toml:22:1: RUF200 Failed to parse pyproject.toml: missing field `requires`
```
Overall, this emitted errors in 43 out of 3408 projects (`rg -c RUF200 target/ecosystem_all_results/ | wc -l`)


Co-authored-by: Micha Reiser <micha@reiser.io>
2023-05-25 12:05:28 +00:00
Charlie Marsh f4572fe40b
Bump version to 0.0.270 (#4637) 2023-05-24 16:34:29 +00:00
Micha Reiser 6943beee66
Remove source position from `FormatElement::DynamicText` (#4619) 2023-05-24 16:36:14 +02:00
Micha Reiser 652c644c2a
Introduce `ruff_index` crate (#4597) 2023-05-23 17:40:35 +02:00
Micha Reiser 154439728a
Add `AnyNode` and `AnyNodeRef` unions (#4578) 2023-05-23 08:53:22 +02:00
Christopher Covington 3b8121379d
Name ambiguous characters (#4448) 2023-05-22 17:16:57 +00:00
Micha Reiser daadd24bde
Include decorators in `Function` and `Class` definition ranges (#4467) 2023-05-22 17:50:42 +02:00
Micha Reiser 063431cb0f
Upgrade RustPython (#4576) 2023-05-22 14:50:49 +02:00
Micha Reiser 2f35099f81
Remove `regex` dependency from `ruff_python_ast` (#4518) 2023-05-19 06:44:18 +00: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
figsoda bab818e801
Update RustPython dependencies (#4503) 2023-05-18 15:28:13 -04:00
Jeong, YunWon 4b05ca1198
Specialize ConversionFlag (#4450) 2023-05-16 18:00:13 +02:00
Charlie Marsh f0465bf106
Emit non-logical newlines for "empty" lines (#4444) 2023-05-16 14:58:56 +00:00
Jeong, YunWon 6049aabe27
Update RustPyhon and enable full-lexer feature (#4442) 2023-05-16 07:19:57 +00:00
Micha Reiser fa26860296
Refactor range from `Attributed` to `Node`s (#4422) 2023-05-16 06:36:32 +00:00
Micha Reiser 7e7be05ddf
Upgrade dependencies (#4389) 2023-05-13 13:00:25 +00:00
Micha Reiser f5afa8198c
Use new `rustpython_format` crate over `rustpython-common` (#4388) 2023-05-13 12:35:02 +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
Jeong, YunWon bbadbb5de5
Refactor code to use the new RustPython `is` method (#4369) 2023-05-11 16:16:36 +02:00
Jeong, YunWon be6e00ef6e
Re-integrate RustPython parser repository (#4359)
Co-authored-by: Micha Reiser <micha@reiser.io>
2023-05-11 07:47:17 +00:00
Charlie Marsh 11e1380df4
Bump version to 0.0.265 (#4248) 2023-05-05 13:16:05 -04:00
Charlie Marsh 8cb76f85eb
Bump version to 0.0.264 (#4179) 2023-05-01 23:33:38 -07:00
Micha Reiser e04ef42334
Use `memchr` to speedup newline search on x86 (#3985) 2023-04-26 20:15:47 +01:00
Micha Reiser cab65b25da
Replace row/column based `Location` with byte-offsets. (#3931) 2023-04-26 18:11:02 +00:00
Charlie Marsh 7266eb0d69
Add support for providing command-line arguments via `argfile` (#4087) 2023-04-25 17:58:21 -06:00
Charlie Marsh fd7ccb4c9e
Bump version to 0.0.263 (#4086) 2023-04-24 23:32:29 -06:00
Micha Reiser ba4f4f4672
Upgrade dependencies (#4064) 2023-04-22 18:04:01 +01:00
Charlie Marsh 25a6bfa9ee
Bump version to 0.0.262 (#4032) 2023-04-19 15:49:28 -04:00
Micha Reiser 280dffb5e1
Add parser benchmark (#3990) 2023-04-17 16:43:59 +02:00
Micha Reiser e8aebee3f6
Pretty print `Diagnostic`s in snapshot tests (#3906) 2023-04-11 09:03:00 +00:00
Micha Reiser 381203c084
Store source code on message (#3897) 2023-04-11 07:57:36 +00:00
Micha Reiser 76c47a9a43
Cheap cloneable LineIndex (#3896) 2023-04-11 07:33:40 +00:00
Micha Reiser 9209e57c5a
Extract message emitters from Printer (#3895) 2023-04-11 07:24:25 +00:00
Charlie Marsh 255b094b33
Bump version to 0.0.261 (#3881) 2023-04-04 22:31:01 -04:00
Charlie Marsh d919adc13c
Introduce a `ruff_python_semantic` crate (#3865) 2023-04-04 16:50:47 +00:00
Chris Chan 10504eb9ed
Generate `ImportMap` from module path to imported dependencies (#3243) 2023-04-04 03:31:37 +00:00
konstin f4cda31708
Use crates.io version of pep440_rs (#3812)
* Use crates.io version of pep440_rs

* Update Cargo.lock
2023-03-30 12:47:07 +00:00
Charlie Marsh 9d3b8eb67b
Bump version to v0.0.260 (#3799) 2023-03-29 14:51:50 -04:00
Micha Reiser 113a8b8fda
perf(pycodestyle): Reduce allocations when computing logical lines (#3715) 2023-03-28 09:09:27 +02:00
Charlie Marsh e603382cf0
Allow diagnostics to generate multi-edit fixes (#3709) 2023-03-26 16:45:19 -04:00
Agriya Khetarpal c0befb4670
Use `wild::args()` and add `wild` as a dependency (#3739) 2023-03-26 14:32:45 +00:00
Charlie Marsh 5c7898124f
Traverse over nested string type annotations (#3724) 2023-03-25 21:56:09 -04:00
Micha Reiser 7af83460ce
Use unicode-width to determine line-length instead of character count (#3714) 2023-03-24 17:17:05 -04:00
Jonathan Plasse dc4d7619ee
Add `Diagnostic.try_amend()` to simplify error handling (#3701) 2023-03-24 17:10:11 -04: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
Micha Reiser f59a22b6e5
Remove unused dependencies (#3644) 2023-03-21 11:02:41 +01:00
konstin 81d0884974
Add basic jupyter notebook support (#3440)
* Add basic jupyter notebook support behind a feature flag

* Address review comments

* Rename in separate commit to make both git and clippy happy

* cfg(feature = "jupyter_notebook") another test

* Address more review comments

* Address more review comments

* and clippy and windows

* More review comment
2023-03-20 12:06:01 +01:00
Charlie Marsh 0c4926ff7b
Bump version to v0.0.257 (#3591) 2023-03-17 22:34:10 -04:00
Micha Reiser 87fab4a2e1
Benchmark all rules (#3570) 2023-03-17 19:29:39 +01:00
Charlie Marsh 12dfd57211
Bump version to v0.0.256 (#3531) 2023-03-14 22:52:21 -04:00
Charlie Marsh 106a93eab0
Make Clap an optional feature for ruff crate (#3498) 2023-03-14 11:02:05 -04:00
Micha Reiser d5700d7c69
Add Micro Benchmark (#3466) 2023-03-14 08:35:07 +01:00
Charlie Marsh aa97a092bd
Bump version to v0.0.255 (#3485) 2023-03-13 14:06:51 -04:00
Jonathan Plasse b540407b74
Infer target-version from project metadata (#3470)
* Infer target-version from project metadata

* Fix requires-python with ">=3.8.16"

* Load requires-python at runtime

* Use upstream VersionSpecifiers

* Add debug information when parsing ruff.toml

* Display debug only if target_version is not set

* Bump pep440-rs to add impl Error for Pep440Error
2023-03-13 18:16:01 +01:00
Charlie Marsh 3a5fbd6d74
Upgrade RustPython to fix Serde dependency (#3481) 2023-03-13 12:29:31 -04:00
Charlie Marsh c2750a59ab
Implement an iterator for universal newlines (#3454)
# Summary

We need to support CR line endings (as opposed to LF and CRLF line endings, which are already supported). They're rare, but they do appear in Python code, and we tend to panic on any file that uses them.

Our `Locator` abstraction now supports CR line endings. However, Rust's `str#lines` implementation does _not_.

This PR adds a `UniversalNewlineIterator` implementation that respects all of CR, LF, and CRLF line endings, and plugs it into most of the `.lines()` call sites.

As an alternative design, it could be nice if we could leverage `Locator` for this. We've already computed all of the line endings, so we could probably iterate much more efficiently?

# Test Plan

Largely relying on automated testing, however, also ran over some known failure cases, like #3404.
2023-03-13 00:01:29 -04:00
Charlie Marsh 7a80bcec58
Output GitLab paths relative to `CI_PROJECT_DIR` (#3475) 2023-03-13 03:03:37 +00:00
Charlie Marsh 024caca233
Introduce a `ruff_diagnostics` crate (#3409)
## Summary

This PR moves `Diagnostic`, `DiagnosticKind`, and `Fix` into their own crate, which will enable us to further split up Ruff, since sub-linter crates (which need to implement functions that return `Diagnostic`) can now depend on `ruff_diagnostics` rather than Ruff.
2023-03-09 20:48:57 +00:00
Micha Reiser 229f1c34cb
refactor: Extract `ruff_wasm` (#3401) 2023-03-09 10:07:39 +00:00
Charlie Marsh ff2c0dd491
Use shared `leading_quote` implementation in ruff_python_formatter (#3396) 2023-03-08 18:21:59 +00:00
Charlie Marsh bad6bdda1f
Create a `rust_python_ast` crate (#3370)
This PR productionizes @MichaReiser's suggestion in https://github.com/charliermarsh/ruff/issues/1820#issuecomment-1440204423, by creating a separate crate for the `ast` module (`rust_python_ast`). This will enable us to further split up the `ruff` crate, as we'll be able to create (e.g.) separate sub-linter crates that have access to these common AST utilities.

This was mostly a straightforward copy (with adjustments to module imports), as the few dependencies that _did_ require modifications were handled in #3366, #3367, and #3368.
2023-03-07 15:18:40 +00:00
Charlie Marsh d1c48016eb
Rename `ruff_python` crate to `ruff_python_stdlib` (#3354)
In hindsight, `ruff_python` is too general. A good giveaway is that it's actually a prefix of some other crates. The intent of this crate is to reimplement pieces of the Python standard library and CPython itself, so `ruff_python_stdlib` feels appropriate.
2023-03-06 13:43:22 +00:00
konstin 22e6778e17
Add `cargo dev generate-all --check` and catch outdated docs in `cargo test` (#3320) 2023-03-06 11:28:38 +01:00
Charlie Marsh 376ef929b1
Upgrade RustPython (#3341) 2023-03-04 14:01:03 -05:00
Jonathan Plasse 8828e12283
Bump dependencies and move more shared dependencies into workspace (#3340) 2023-03-04 12:36:26 -05:00
Charlie Marsh bbbc44336e
Bump version to 0.0.254 (#3331) 2023-03-03 19:11:07 -05:00
Charlie Marsh dedf8aa5cc
Use presence of convention-specific sections during docstring inference (#3325) 2023-03-03 17:13:11 -05:00
Micha Reiser cdbe2ee496
refactor: Introduce `CacheKey` trait (#3323)
This PR introduces a new `CacheKey` trait for types that can be used as a cache key.

I'm not entirely sure if this is worth the "overhead", but I was surprised to find `HashableHashSet` and got scared when I looked at the time complexity of the `hash` function. These implementations must be extremely slow in hashed collections.

I then searched for usages and quickly realized that only the cache uses these `Hash` implementations, where performance is less sensitive.

This PR introduces a new `CacheKey` trait to communicate the difference between a hash and computing a key for the cache. The new trait can be implemented for types that don't implement `Hash` for performance reasons, and we can define additional constraints on the implementation:  For example, we'll want to enforce portability when we add remote caching support. Using a different trait further allows us not to implement it for types without stable identities (e.g. pointers) or use other implementations than the standard hash function.
2023-03-03 18:29:49 +00:00
Charlie Marsh 4de3882088
Upgrade RustPython (#3316) 2023-03-02 22:59:29 -05:00
Andy Freeland 0ed9fccce9
Upgrade RustPython (#3277)
Fixes #3207.
2023-02-28 12:21:28 -05:00
Charlie Marsh 061495a9eb
Make BoolOp its own located token (#3265) 2023-02-28 03:43:28 +00:00
Charlie Marsh d2a6ed7be6
Upgrade RustPython (#3252) 2023-02-27 18:21:06 +00:00
Charlie Marsh 386ca7c9a1
Bump version to 0.0.253 (#3245) 2023-02-26 23:10:04 -05:00
Jeong YunWon 84e96cdcd9
More enum work (#3212) 2023-02-25 11:40:16 -05:00
Charlie Marsh eef85067c8
Exclude globsets for --show-settings (#3201) 2023-02-24 04:23:00 +00:00
Jeong YunWon da98fab4ae
Adapt is-macro for a few enums (#3182) 2023-02-24 04:06:56 +00:00
Charlie Marsh c9fe0708cb
Run `cargo update` (#3179) 2023-02-23 12:09:36 -05:00
Charlie Marsh 09f8c487ea
Update RustPython to support *tuple annotations (#3178) 2023-02-23 16:58:38 +00:00
Charlie Marsh f967f344fc
Add support for basic `Constant::Str` formatting (#3173)
This PR enables us to apply the proper quotation marks, including support for escapes. There are some significant TODOs, especially around implicit concatenations like:

```py
(
  "abc"
  "def"
)
```

Which are represented as a single AST node, which requires us to tokenize _within_ the formatter to identify all the individual string parts.
2023-02-23 16:23:10 +00:00
Charlie Marsh 095f005bf4
Move RustPython vendored and helper code into its own crate (#3171) 2023-02-23 14:14:16 +00:00
Jeong YunWon 77d43795f8
Replace Autofix::is_enabled to result_like::BoolLike (#3165) 2023-02-23 07:29:13 -05:00
Charlie Marsh 1c41789c2a
Bump version to 0.0.252 (#3142) 2023-02-22 14:50:14 -05:00
Charlie Marsh 2f9de335db
Upgrade RustPython to match new flattened exports (#3141) 2023-02-22 19:36:13 +00:00
Charlie Marsh f0e0efc46f
Upgrade RustPython to handle trailing commas in map patterns (#3130) 2023-02-22 11:17:13 -05:00
Charlie Marsh 1efa2e07ad
Avoid match statement misidentification in token rules (#3129) 2023-02-22 15:44:45 +00:00
Micha Reiser ed33b75bad
test(ruff_python_formatter): Run all Black tests (#2993)
This PR changes the testing infrastructure to run all black tests and:

* Pass if Ruff and Black generate the same formatting
* Fail and write a markdown snapshot that shows the input code, the differences between Black and Ruff, Ruffs output, and Blacks output

This is achieved by introducing a new `fixture` macro (open to better name suggestions) that "duplicates" the attributed test for every file that matches the specified glob pattern. Creating a new test for each file over having a test that iterates over all files has the advantage that you can run a single test, and that test failures indicate which case is failing. 

The `fixture` macro also makes it straightforward to e.g. setup our own spec tests that test very specific formatting by creating a new folder and use insta to assert the formatted output.
2023-02-22 09:25:06 -05:00
Charlie Marsh e37e9c2ca3
Skip EXE001 and EXE002 rules on Windows (#3111) 2023-02-21 23:39:56 -05:00
Charlie Marsh 9645790a8b
Support shell expansion for --config argument (#3107) 2023-02-21 23:33:41 +00:00
Charlie Marsh fd638a2e54
Bump version to 0.0.251 (#3105) 2023-02-21 18:13:59 -05:00
Charlie Marsh 06e426f509
Bump version to 0.0.250 (#3095) 2023-02-21 15:20:46 -05:00
Charlie Marsh d5c65b5f1b
Add support for structural pattern matching (#3047) 2023-02-21 18:52:10 +00:00
Charlie Marsh cdc4e86158
Add support for TryStar (#3089) 2023-02-21 13:42:20 -05:00
Charlie Marsh 4cfa350112
Bump version to 0.0.249 (#3063) 2023-02-20 13:11:29 -05:00
Charlie Marsh 2ff3dd5fbe
Bump version to 0.0.248 (#3034) 2023-02-19 16:21:30 +00:00
Charlie Marsh 370c3a5daf
Remove mdcat dependency (#2959) 2023-02-16 12:09:37 -05:00
Martin Fischer 294cd95c54 Update clap to fix `ruff check --help` description
My two clap bug fixes[1][2] have been merged and released
(see the change in README.md).

[1]: https://github.com/clap-rs/clap/pull/4710
[2]: https://github.com/clap-rs/clap/pull/4712
2023-02-15 13:30:06 -05:00
Charlie Marsh 39fdc71b49
Bump version to 0.0.247 (#2932) 2023-02-15 12:06:58 -05:00
Charlie Marsh ca49b00e55
Add initial formatter implementation (#2883)
# Summary

This PR contains the code for the autoformatter proof-of-concept.

## Crate structure

The primary formatting hook is the `fmt` function in `crates/ruff_python_formatter/src/lib.rs`.

The current formatter approach is outlined in `crates/ruff_python_formatter/src/lib.rs`, and is structured as follows:

- Tokenize the code using the RustPython lexer.
- In `crates/ruff_python_formatter/src/trivia.rs`, extract a variety of trivia tokens from the token stream. These include comments, trailing commas, and empty lines.
- Generate the AST via the RustPython parser.
- In `crates/ruff_python_formatter/src/cst.rs`, convert the AST to a CST structure. As of now, the CST is nearly identical to the AST, except that every node gets a `trivia` vector. But we might want to modify it further.
- In `crates/ruff_python_formatter/src/attachment.rs`, attach each trivia token to the corresponding CST node. The logic for this is mostly in `decorate_trivia` and is ported almost directly from Prettier (given each token, find its preceding, following, and enclosing nodes, then attach the token to the appropriate node in a second pass).
- In `crates/ruff_python_formatter/src/newlines.rs`, normalize newlines to match Black’s preferences. This involves traversing the CST and inserting or removing `TriviaToken` values as we go.
- Call `format!` on the CST, which delegates to type-specific formatter implementations (e.g., `crates/ruff_python_formatter/src/format/stmt.rs` for `Stmt` nodes, and similar for `Expr` nodes; the others are trivial). Those type-specific implementations delegate to kind-specific functions (e.g., `format_func_def`).

## Testing and iteration

The formatter is being developed against the Black test suite, which was copied over in-full to `crates/ruff_python_formatter/resources/test/fixtures/black`.

The Black fixtures had to be modified to create `[insta](https://github.com/mitsuhiko/insta)`-compatible snapshots, which now exist in the repo.

My approach thus far has been to try and improve coverage by tackling fixtures one-by-one.

## What works, and what doesn’t

- *Most* nodes are supported at a basic level (though there are a few stragglers at time of writing, like `StmtKind::Try`).
- Newlines are properly preserved in most cases.
- Magic trailing commas are properly preserved in some (but not all) cases.
- Trivial leading and trailing standalone comments mostly work (although maybe not at the end of a file).
- Inline comments, and comments within expressions, often don’t work -- they work in a few cases, but it’s one-off right now. (We’re probably associating them with the “right” nodes more often than we are actually rendering them in the right place.)
- We don’t properly normalize string quotes. (At present, we just repeat any constants verbatim.)
- We’re mishandling a bunch of wrapping cases (if we treat Black as the reference implementation). Here are a few examples (demonstrating Black's stable behavior):

```py
# In some cases, if the end expression is "self-closing" (functions,
# lists, dictionaries, sets, subscript accesses, and any length-two
# boolean operations that end in these elments), Black
# will wrap like this...
if some_expression and f(
    b,
    c,
    d,
):
    pass

# ...whereas we do this:
if (
    some_expression
    and f(
        b,
        c,
        d,
    )
):
    pass

# If function arguments can fit on a single line, then Black will
# format them like this, rather than exploding them vertically.
if f(
    a, b, c, d, e, f, g, ...
):
    pass
```

- We don’t properly preserve parentheses in all cases. Black preserves parentheses in some but not all cases.
2023-02-15 04:06:35 +00:00
Charlie Marsh f661c90bd7
Remove dependency on `ruff_rowan` (#2875)
This PR removes the dependency on `ruff_rowan` (i.e., Rome's fork of rust-analyzer's `rowan`), and in turn, trims out a lot of code in `ruff_formatter` that isn't necessary (or isn't _yet_ necessary) to power the autoformatter.

We may end up pulling some of this back in -- TBD. For example, the autoformatter has its own comment representation right now, but we may eventually want to use the `comments.rs` data structures defined in `rome_formatter`.
2023-02-15 03:54:08 +00:00
Charlie Marsh 3ef1c2e303
Add `rome_formatter` fork as `ruff_formatter` (#2872)
The Ruff autoformatter is going to be based on an intermediate representation (IR) formatted via [Wadler's algorithm](https://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf). This is architecturally similar to [Rome](https://github.com/rome/tools), Prettier, [Skip](https://github.com/skiplang/skip/blob/master/src/tools/printer/printer.sk), and others.

This PR adds a fork of the `rome_formatter` crate from [Rome](https://github.com/rome/tools), renamed here to `ruff_formatter`, which provides generic definitions for a formatter IR as well as a generic IR printer. (We've also pulled in `rome_rowan`, `rome_text_size`, and `rome_text_edit`, though some of these will be removed in future PRs.)

Why fork? `rome_formatter` contains code that's specific to Rome's AST representation (e.g., it relies on a fork of rust-analyzer's `rowan`), and we'll likely want to support different abstractions and formatting capabilities (there are already a few changes coming in future PRs). Once we've dropped `ruff_rowan` and trimmed down `ruff_formatter` to the code we currently need, it's also not a huge surface area to maintain and update.
2023-02-14 19:22:55 -05:00
Martin Fischer a77b4566e4 Fix option links in mkdocs rule pages
In 28c9263722 I introduced automatic
linkification of option references in rule documentation,
which automatically converted the following:

    ## Options

    * `namespace-packages`

to:

    ## Options

    * [`namespace-packages`]

    [`namespace-packages`]: ../../settings#namespace-packages

While the above is a correct CommonMark[1] link definition,
what I was missing was that we used mkdocs for our documentation
generation, which as it turns out uses a non-CommonMark-compliant
Markdown parser, namely Python-Markdown, which contrary to CommonMark
doesn't support link definitions containing code tags.

This commit fixes the broken links via a regex hack.

[1]: https://commonmark.org/
2023-02-14 17:56:21 -05:00
Charlie Marsh 4dd2032687
Unversion unpublished crates (#2882) 2023-02-14 03:03:49 +00:00
Charlie Marsh 2bf7b35268
Re-enable custom allocators (#2876) 2023-02-14 02:37:22 +00:00
Charlie Marsh 48a5cd1dd9
Revert "perf: Use custom allocator (#2768)" (#2841)
This is causing wheel creation to fail on some of our more exotic build targets: https://github.com/charliermarsh/ruff/actions/runs/4159524132.

Let's figure out how to gate appropriately, but for now, reverting to get the release out.
2023-02-12 22:31:34 -05:00
Charlie Marsh 83f6e52c92
Bump version to 0.0.246 (#2834) 2023-02-12 23:39:51 +00:00
Charlie Marsh 1666e8ba1e
Add a `--show-fixes` flag to include applied fixes in output (#2707) 2023-02-12 20:48:01 +00:00
Charlie Marsh 9089ef74bc
Upgrade RustPython (#2821) 2023-02-12 18:45:59 +00:00
Nick Pope 551b810aeb
Add rendering of rule markdown for terminal output (#2747)
Add rendering of rule markdown for terminal output
    
This is achieved by making use of the `mdcat` crate.
    
See the following links for details:
    
- https://crates.io/crates/mdcat
- https://github.com/swsnr/mdcat
- https://docs.rs/mdcat/latest/mdcat/
2023-02-12 02:32:45 +00:00
Micha Reiser 863e39fe5f
perf: Use custom allocator (#2768)
This PR replaces the system allocator with a custom allocator to improve performance:

* Windows: mimalloc
* Unix: tikv-jemallocator

## Performance:

* Linux
  * `cpython --no-cache`: 208.8ms -> 190.5ms
  * `cpython`: 32.8ms -> 31ms
* Mac: 
  * `cpython --no-cache`: 436.3ms -> 380ms
  * `cpython`: 40.9ms -> 39.6ms
* Windows: 
  * `cpython --no-cache`: 367ms -> 268ms
  * `cpython`: 92.5ms -> 92.3ms
  
## Size

* Linux: +5MB from 13MB -> 18MB (I need to double check this)
* Mac: +0.7MB from 8.3MB-> 9MB
* Windows: -0.16MB from 8.29MB -> 8.13MB (that's unexpected)
2023-02-11 13:26:07 -05:00
Charlie Marsh 24faabf1f4 Bump version to 0.0.245 2023-02-10 22:15:27 -05:00
Martin Fischer bd09a1819f Drop unused once_cell dependency from ruff_macros 2023-02-10 09:25:29 -05:00
Charlie Marsh 0f622f0126
Upgrade RustPython to pull in newline-handling optimizations (#2688) 2023-02-09 11:12:43 -05:00
Charlie Marsh 125615af12 Bump version to 0.0.244 2023-02-08 17:28:59 -05:00
Charlie Marsh f1cdd108e6
Derive `explanation` method on Rule struct via rustdoc (#2642)
```console
❯ cargo run rule B017
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s
     Running `target/debug/ruff rule B017`
no-assert-raises-exception

Code: B017 (flake8-bugbear)

### What it does
Checks for `self.assertRaises(Exception)`.

## Why is this bad?
`assertRaises(Exception)` can lead to your test passing even if the
code being tested is never executed due to a typo.

Either assert for a more specific exception (builtin or custom), use
`assertRaisesRegex` or the context manager form of `assertRaises`.
```
2023-02-07 17:23:29 -05:00
Charlie Marsh 8fd29b3b60
Remove dependency on `"unparse"` feature (#2641) 2023-02-07 17:23:09 -05:00
Charlie Marsh bf718fdf26 Bump Ruff version to 0.0.243 2023-02-06 21:22:54 -05:00
Charlie Marsh e59b75d31b Bump version to 0.0.242 2023-02-06 16:25:29 -05:00
Charlie Marsh 87d0aa5561
Move `python` into its own `ruff_python` crate (#2593) 2023-02-05 17:53:58 -05:00
Micha Reiser cd8be8c0be
refactor: Introduce crates folder (#2088)
This PR introduces a new `crates` directory and moves all "product" crates into that folder. 

Part of #2059.
2023-02-05 16:47:48 -05:00
Charlie Marsh e3dfa2e04e
Implement pycodestyle's logical line detection (#1130)
Along with the logical line detection, this adds 14 of the missing `pycodestyle` rules.

For now, this is all gated behind a `logical_lines` feature that's off-by-default, which will let us implement all rules prior to shipping, since we want to couple the release of these rules with new defaults and instructions.
2023-02-05 15:06:02 -05:00
Charlie Marsh 7d4f0a8320 Bump Ruff version to 0.0.241 2023-02-03 19:25:12 -05:00
Charlie Marsh da0374f360
Update RustPython to pull in lexer optimizations (#2551) 2023-02-03 14:31:53 -05:00
Aarni Koskela 38addbe50d
Soft-deprecate update_check (#2530) 2023-02-03 11:33:38 -05:00
Charlie Marsh 651f6b6bce Bump Ruff version to 0.0.240 2023-02-02 12:45:23 -05:00
Charlie Marsh c15595325c Bump version to 0.0.239 2023-01-31 19:06:22 -05:00
Charlie Marsh 1cbd929a0a Bump version to 0.0.238 2023-01-30 16:44:19 -05:00
Charlie Marsh add7fefeb5 Bump version to 0.0.237 2023-01-28 10:52:14 -05:00
Charlie Marsh 685d9ab848 Bump version to 0.0.236 2023-01-26 18:47:00 -05:00
Charlie Marsh b346f74915
Run cargo update (#2185) 2023-01-25 21:32:44 -05:00
Charlie Marsh edd0e16a02 Bump version to 0.0.235 2023-01-25 18:28:27 -05:00
Simon Brugman 413acdf83c feat: introduce macro for testing snap files across platforms 2023-01-25 18:00:39 -05:00
Charlie Marsh 9b07d0bd92 Bump version to 0.0.234 2023-01-25 16:55:57 -05:00
Charlie Marsh 605416922d Bump version to 0.0.233 2023-01-24 10:46:49 -05:00
Charlie Marsh 7b81f36e54
Enable executable checks on Windows (#2133) 2023-01-24 10:46:27 -05:00
Charlie Marsh d645a19e0a Bump version to 0.0.232 2023-01-24 09:49:07 -05:00
Charlie Marsh 549a5d44bc
Upgrade to toml v0.6.0 (#2116)
Closes #1894.
2023-01-23 19:22:42 -05:00
Charlie Marsh 1c3265ef98 Bump version to 0.0.231 2023-01-23 12:51:09 -05:00
Charlie Marsh 23b622943e Bump version to 0.0.230 2023-01-22 13:58:41 -05:00
Harutaka Kawamura a7ce8621a9
Update RustPython to fix `Dict.keys` type (#2086)
This PR upgrades RustPython to fix the type of `Dict.keys` to `Vec<Option<Expr>>` (see https://github.com/RustPython/RustPython/pull/4449 for why this change was needed) and unblock #1884.
2023-01-22 13:24:00 -05:00
Charlie Marsh 6bfa1804de
Remove remaining `ropey` usages (#2076) 2023-01-21 18:24:10 -05:00
figsoda b1bda0de82
fix: pin rustpython to the same revision to fix cargo vendor (#2069)
I was trying to update ruff in nixpkgs and ran into this error when it was running `cargo vendor`
```
error: failed to sync

Caused by:
  found duplicate version of package `rustpython-ast v0.2.0` vendored from two sources:

        source 1: https://github.com/RustPython/RustPython.git?rev=62aa942bf506ea3d41ed0503b947b84141fdaa3c#62aa942b
        source 2: https://github.com/RustPython/RustPython.git?rev=ff90fe52eea578c8ebdd9d95e078cc041a5959fa#ff90fe52
```
2023-01-21 14:40:00 -05:00
Charlie Marsh 84300e00ff Bump version to 0.0.229 2023-01-21 13:18:06 -05:00
Colin Delahunty 80295f335b
Pyupgrade: Printf string formatting (#1803) 2023-01-21 09:37:22 -05:00
Charlie Marsh 465943adf7
Revert "Upgrade to toml v0.5.11" (#2058)
This _did_ fix https://github.com/charliermarsh/ruff/issues/1894, but was a little premature. `toml` doesn't actually depend on `toml-edit` yet, and `v0.5.11` was mostly about deprecations AFAICT. So upgrading might solve that issue, but could introduce other incompatibilities, and I'd like to minimize churn. I expect that `toml` will have a new release soon, so we can revert this revert.

Reverts charliermarsh/ruff#2040.
2023-01-21 07:54:56 -05:00
Charlie Marsh 20a9252e92
Upgrade to toml v0.5.11 (#2040)
In #1680, we moved over to `toml_edit`. But it looks like `toml` now uses `toml_edit`, and has implemented some improvements (e.g., this closes #1894).
2023-01-20 17:20:45 -05:00
Charlie Marsh 5377d24507 Bump version to 0.0.228 2023-01-20 09:58:56 -05:00
Aarni Koskela 3a81f893cc
Bump terminfo to remove a whole bunch of unnecessary dependencies (#2022)
See 6281c6b8f7

```
$ cargo update -p terminfo
    Updating crates.io index
    Removing cfg-if v0.1.10
    Removing dirs v2.0.2
    Removing getrandom v0.1.16
    Removing phf v0.8.0
    Updating phf_codegen v0.8.0 -> v0.11.1
    Updating phf_generator v0.8.0 -> v0.11.1
    Removing phf_shared v0.8.0
    Removing rand v0.7.3
    Removing rand_chacha v0.2.2
    Removing rand_core v0.5.1
    Removing rand_hc v0.2.0
    Removing rand_pcg v0.2.1
    Updating terminfo v0.7.3 -> v0.7.5
    Removing wasi v0.9.0+wasi-snapshot-preview1
```
2023-01-20 09:09:02 -05:00
Aarni Koskela bea6deb0c3
Port pydocstyle code 401 (ImperativeMood) (#1999)
This adds support for pydocstyle code D401 using the `imperative` crate.
2023-01-20 07:18:27 -05:00
Charlie Marsh cf56955ba6 Bump version to 0.0.227 2023-01-19 23:24:52 -05:00
Charlie Marsh 045229630e
Upgrade RustPython (#2011)
This lets us revert the "manual" fix introduced in #1944.
2023-01-19 21:49:12 -05:00
Martin Fischer 6cf770a692 rule 5/8: Remove FromStr impl for Rule 2023-01-18 23:51:48 -05:00
Charlie Marsh d8645acd1f Bump version to 0.0.226 2023-01-18 20:54:38 -05:00
Charlie Marsh dae95626ae
Use `smallvec` for call path representation (#1960)
This provides a ~10% speed-up for large codebases with `--select ALL`:

![Screen Shot 2023-01-18 at 11 28 20 AM](https://user-images.githubusercontent.com/1309177/213236389-cff50840-6e55-47a3-9164-2e40cbc885f6.png)
2023-01-18 11:29:05 -05:00
Charlie Marsh cdb4700813 Bump version to 0.0.225 2023-01-18 00:22:48 -05:00
Charlie Marsh 74a8a218f3 Bump version to 0.0.224 2023-01-16 23:43:14 -05:00
Charlie Marsh 3a3a5fcd81 Remove -dev suffix from flake8_to_ruff 2023-01-15 22:45:14 -05:00
Charlie Marsh e8577d5e26 Bump version to 0.0.223 2023-01-15 22:44:01 -05:00
Charlie Marsh e3cc918b93 Bump version to 0.0.222 2023-01-14 23:34:53 -05:00
Ran Benita 3447dd3615
Bump RustPython (#1836)
This bumps RustPython so we can use the new `NonLogicalNewline` token.
A couple of rules needed a fix due to the new token. There might be more
that are not caught by tests (anything working with tokens directly with
lookaheads), I hope not.
2023-01-14 08:03:27 -05:00
Charlie Marsh 931d41bff1 Revert "Bump version to 0.0.222"
This reverts commit 852aab5758.
2023-01-13 23:56:29 -05:00
Charlie Marsh 852aab5758 Bump version to 0.0.222 2023-01-13 23:50:08 -05:00
Charlie Marsh ee6c81d02a Bump version to 0.0.221 2023-01-13 23:33:15 -05:00
Martin Fischer 82aff5f9ec Split off ruff_cli crate from ruff library
This lets you test the ruff linters or use the ruff library
without having to compile the ~100 additional dependencies
that are needed by the CLI.

Because we set the following in the [workspace] section of Cargo.toml:

   default-members = [".", "ruff_cli"]

`cargo run` still runs the CLI and `cargo test` still tests
the code in src/ as well as the code in the new ruff_cli crate.
(But you can now also run `cargo test -p ruff` to only test the linters.)
2023-01-13 21:37:54 -05:00
Charlie Marsh 9aeb5df5fe Bump version to 0.0.220 2023-01-12 17:57:04 -05:00
Charlie Marsh d8162ce79d Bump version to 0.0.219 2023-01-11 23:46:01 -05:00
Charlie Marsh cfbd068dd5 Bump version to 0.0.218 2023-01-10 21:28:23 -05:00
Charlie Marsh edab268d50 Bump version to 0.0.217 2023-01-09 23:26:22 -05:00
Charlie Marsh 2cb59b0f45
Use dedicated warnings for flake8-to-ruff (#1748) 2023-01-09 12:48:06 -05:00
Charlie Marsh caf6c65de7 Bump version to 0.0.216 2023-01-09 01:14:28 -05:00
Charlie Marsh 0152814a00 Bump version to 0.0.215 2023-01-07 22:17:29 -05:00
Charlie Marsh edf46c06d0 Bump version to 0.0.214 2023-01-07 15:34:45 -05:00
Harutaka Kawamura 5cdd7ccdb8
Use text in comment token (#1714)
https://github.com/RustPython/RustPython/pull/4426 has been merged. We
can simplify code using text in comment tokens.
2023-01-07 07:29:04 -05:00
Charlie Marsh f1c3ebfe0f Bump version to 0.0.213 2023-01-07 00:30:56 -05:00
messense 43575da537
Replace `toml` with `toml_edit` (#1680)
The `toml` crate doesn't support TOML 1.0, but `toml_edit` does. While
there is a plan to [migrate `toml` to be on
`toml_edit`](https://github.com/toml-rs/toml/issues/340), it's not ready
yet and it's very easy to switch back to `toml` when it's ready.
2023-01-05 22:08:23 -05:00
Charlie Marsh ee4cae97d5 Bump version to 0.0.212 2023-01-05 21:25:42 -05:00
messense 1991d618a3
Add proc-macro to derive `CheckCodePrefix` (#1656)
IMO a derive macro is a natural way to generate new code, and it reduces
the chance of merge conflicts.
2023-01-05 11:39:16 -05:00
Charlie Marsh 7b59cd2d32 Bump version to 0.0.211 2023-01-04 23:13:04 -05:00
Charlie Marsh aacfc9ee0b Bump version to 0.0.210 2023-01-03 21:46:08 -05:00
Charlie Marsh e9a236f740 Bump version to 0.0.209 2023-01-03 08:27:28 -05:00
Charlie Marsh 8b277138de Bump version to 0.0.208 2023-01-02 23:19:03 -05:00
Oliver Margetts cd5882c66d
Remove need for vendored format/cformat code (#1573) 2023-01-02 19:37:31 -05:00
Charlie Marsh 14042800c2
Remove common-path dependency (#1565) 2023-01-02 17:23:29 -05:00
Edgar R. M c4014ef2d3
Implement `flake8-pytest-style` (#1506) 2023-01-02 16:34:17 -05:00
Charlie Marsh f74050e5b1 Bump version to 0.0.207 2023-01-02 14:39:32 -05:00
Charlie Marsh 2315db7d13 Bump version to 0.0.206 2023-01-01 16:39:29 -05:00
Harutaka Kawamura 4b8e30f350
Fix `Name` node range in `NamedExpr` node (#1526) 2023-01-01 02:41:49 -05:00
Charlie Marsh 0e8c237167 Bump version to 0.0.205 2022-12-31 13:44:39 -05:00
Charlie Marsh 0c215365ae Bump version to 0.0.204 2022-12-31 08:20:09 -05:00
Harutaka Kawamura 3e23fd1487
Stop overriding locations for expressions within f-strings (#1494) 2022-12-30 23:43:59 -05:00
Charlie Marsh 74903f23d6 Bump version to 0.0.203 2022-12-30 15:33:30 -05:00
Charlie Marsh 818582fe8a Bump version to 0.0.202 2022-12-30 08:16:32 -05:00
Charlie Marsh 4a6e5d1549 Bump version to 0.0.201 2022-12-29 23:01:35 -05:00
Charlie Marsh 118a93260a Bump version to 0.0.200 2022-12-29 13:31:23 -05:00
Charlie Marsh 057414ddd4 Bump version to 0.0.199 2022-12-28 20:58:43 -05:00
Charlie Marsh 058ee8e6bf
Add a --diff flag to dry-run autofixes (#1431) 2022-12-28 19:21:29 -05:00
Charlie Marsh c679570041 Bump version to 0.0.198 2022-12-27 21:39:53 -05:00
Charlie Marsh 043d31dcdf Bump version to 0.0.197 2022-12-27 17:05:15 -05:00
Charlie Marsh 3e96803033 Bump version to 0.0.196 2022-12-27 12:02:02 -05:00
Harutaka Kawamura 9106d5338b
Replace `make_tokenize` with `make_tokenizer_located` (#1405) 2022-12-27 10:07:03 -05:00
Charlie Marsh 1e4b1533ad Bump version to 0.0.195 2022-12-26 20:41:39 -05:00
Reiner Gerecke bdb1505262
Web playground with WASM (#1279) 2022-12-26 12:09:17 -05:00
Reiner Gerecke 939f738a71
Update rust python to handle files with BOM (#1379) 2022-12-26 07:03:13 -05:00
Charlie Marsh 5ef8bff341 Bump version to 0.0.194 2022-12-25 19:54:45 -05:00
Charlie Marsh 8b72f55a09
Add `--required-version` (#1376) 2022-12-25 19:53:50 -05:00
Charlie Marsh ec80d1cd85
Respect natural ordering for imports (#1374) 2022-12-25 18:11:41 -05:00
Charlie Marsh f6ca49e05f Bump version to 0.0.193 2022-12-24 14:56:26 -05:00
Edgar R. M 4888afd423
Generate JSON schema for Ruff options (#1329) 2022-12-24 14:10:22 -05:00
Harutaka Kawamura 201e1250de
Update RustPython to use the correct `BinOp` location (#1355) 2022-12-23 22:58:39 -05:00
Charlie Marsh 51bda28a7d Bump version to 0.0.192 2022-12-22 17:31:31 -05:00
Charlie Marsh 03e4f5be8a Bump version to 0.0.191 2022-12-21 21:16:21 -05:00
Charlie Marsh bf5fec342c
Support shell expansion in `extend` paths (#1323) 2022-12-21 20:46:38 -05:00
Charlie Marsh 5c70f5044b
Improve debug logging in flake8-to-ruff (#1320) 2022-12-21 20:05:48 -05:00
Charlie Marsh 20234c6156 Bump version to 0.0.190 2022-12-21 16:01:48 -05:00
Charlie Marsh ef8fe31c0c Bump version to 0.0.189 2022-12-20 13:26:17 -05:00
Charlie Marsh 4107bc828d Bump version to 0.0.188 2022-12-19 12:18:06 -05:00
Charlie Marsh b5ab492a70 Bump version to 0.0.187 2022-12-18 20:09:02 -05:00
Charlie Marsh 1028ed3565 Bump version to 0.0.186 2022-12-18 14:30:30 -05:00
Harutaka Kawamura d3443d7c19
Update RustPython to use correct Tuple location (#1278) 2022-12-18 08:53:57 -05:00
Charlie Marsh a2806eb8ef Bump version to 0.0.185 2022-12-16 23:47:56 -05:00
Charlie Marsh 1e19142d0e Bump version to 0.0.184 2022-12-16 14:36:25 -05:00
Charlie Marsh a9f56ee76e Bump version to 0.0.183 2022-12-15 23:15:12 -05:00
Reiner Gerecke a000cd4a09
Test to prevent continious reformatting when used together with black (#1206) 2022-12-15 15:26:41 -05:00
Charlie Marsh 1ea2e93f8e Bump version to 0.0.182 2022-12-14 22:57:22 -05:00
Charlie Marsh d814ebd21f Bump version to 0.0.181 2022-12-14 17:35:36 -05:00
Charlie Marsh 4b2020d03a
Automatically ignore files specified in `.gitignore` (#1234) 2022-12-14 15:58:40 -05:00
Charlie Marsh 854cd14842 Bump version to 0.0.180 2022-12-14 13:21:10 -05:00
Charlie Marsh 765d21c7b0 Bump version to 0.0.179 2022-12-13 10:17:16 -05:00
Charlie Marsh a58b9b5063
Upgrade RustPython to support parenthesized context managers (#1228) 2022-12-13 10:16:43 -05:00
Charlie Marsh f3e11a30cb Bump version to 0.0.178 2022-12-12 22:06:04 -05:00
Charlie Marsh 92bc417e4e
Add support for glob patterns in `src` (#1225) 2022-12-12 21:35:03 -05:00
Charlie Marsh 19e9eb1af8 Bump version to 0.0.177 2022-12-11 22:38:52 -05:00
Charlie Marsh 9161b866b5 Bump version to 0.0.176 2022-12-11 10:19:50 -05:00
Charlie Marsh c86e52193c Bump version to 0.0.175 2022-12-10 21:23:19 -05:00
Harutaka Kawamura efdc4e801d
Upgrade RustPython to fix end location of implicitly concatenated strings (#1187) 2022-12-10 19:16:01 -05:00
Charlie Marsh 63b3e00c97 Bump version to 0.0.174 2022-12-10 12:08:48 -05:00
Charlie Marsh 257bd7f1d7 Bump version to 0.0.173 2022-12-09 23:23:12 -05:00
Charlie Marsh b35a804f9d Bump version to 0.0.172 2022-12-09 17:47:34 -05:00
Charlie Marsh dfd6225d85 Bump version to 0.0.171 2022-12-08 23:18:48 -05:00
Charlie Marsh a710e35ebc Bump version to 0.0.170 2022-12-08 11:36:24 -05:00
Charlie Marsh 5c8655f479 Bump ruff_macros to 0.0.169 2022-12-07 19:10:16 -05:00
Charlie Marsh a81581c781 Bump ruff_macros to 0.0.168 2022-12-07 19:08:18 -05:00
Charlie Marsh 4405a6a903 Bump version to 0.0.168 2022-12-07 13:18:40 -05:00
Charlie Marsh d698c6123e Bump version to 0.0.167 2022-12-07 10:37:31 -05:00
Charlie Marsh 80e2f0c92e Bump version to 0.0.166 2022-12-06 16:06:19 -05:00
Charlie Marsh f1d3e3698a Bump version to 0.0.165 2022-12-06 00:03:30 -05:00
Charlie Marsh f2ad915224 Bump version to 0.0.164 2022-12-05 23:37:22 -05:00
Reiner Gerecke 982ac6b0ad
Auto-generate options in README from field attributes (#1015) 2022-12-05 22:34:40 -05:00
Charlie Marsh 1339e2a002 Bump version to 0.0.163 2022-12-05 20:45:24 -05:00
Charlie Marsh 995994be3e Bump version to 0.0.162 2022-12-05 19:07:44 -05:00
Charlie Marsh 4b41ae3f53 Bump version to 0.0.161 2022-12-05 17:02:05 -05:00
Charlie Marsh 40b7c64f7d Bump version to 0.0.160 2022-12-05 12:56:38 -05:00
Charlie Marsh 1d1662cb9c Bump version to 0.0.159 2022-12-05 11:22:02 -05:00
messense fb2c457a9b
Upgrade to notify 5.0.0 (#1048) 2022-12-05 09:58:42 -05:00
Charlie Marsh 7024ad7cc7 Bump version to 0.0.158 2022-12-04 21:22:24 -05:00
Charlie Marsh 0685af8a4f
Update RustPython (#1045) 2022-12-04 20:09:28 -05:00
Charlie Marsh 5e9a8fcf53 Bump version to 0.0.157 2022-12-04 14:46:46 -05:00
Charlie Marsh d06dc4c72d Bump version to 0.0.156 2022-12-04 10:22:09 -05:00
Charlie Marsh 4b0c3e3bc9 Bump version to 0.0.155 2022-12-04 00:12:00 -05:00
Charlie Marsh 8a3f29497b
Add backwards compatible redirect map for `U`-to-`UP` rename (#1019) 2022-12-03 22:43:00 -05:00
Charlie Marsh b6b509811d Bump version to 0.0.154 2022-12-03 20:14:38 -05:00
Charlie Marsh e66b786229 Bump version to 0.0.153 2022-12-03 17:05:39 -05:00
Charlie Marsh 1a33ee3fc4 Bump version to 0.0.152 2022-12-02 13:23:00 -05:00
Charlie Marsh 1a24d78f67 Bump version to 0.0.151 2022-12-01 22:31:44 -05:00
Charlie Marsh d699bb7b86 Bump version to 0.0.150 2022-12-01 16:31:18 -05:00
Charlie Marsh 6fa0f21227 Bump version to 0.0.149 2022-11-30 00:51:36 -05:00
messense f5466fe720
Add JUnit xml output format (#968) 2022-11-30 00:47:41 -05:00
Charlie Marsh 30ff4de9a3 Bump version to 0.0.148 2022-11-29 22:50:30 -05:00
Charlie Marsh 2fe22a223b Bump version to 0.0.147 2022-11-29 20:17:58 -05:00
Charlie Marsh 0e6a38e6d8 Bump version to 0.0.146 2022-11-28 22:27:41 -05:00
Charlie Marsh dca994d05f Bump version to 0.0.145 2022-11-28 20:57:58 -05:00
Charlie Marsh 72453695d6 Bump version to 0.0.144 2022-11-28 20:11:08 -05:00
Charlie Marsh ea9acda732 Bump version to 0.0.143 2022-11-28 15:42:25 -05:00
Charlie Marsh e2c4a098de Bump version to 0.0.142 2022-11-28 00:19:27 -05:00
messense 23b4e16b1d
Add shell completions support (#935) 2022-11-27 23:59:36 -05:00
Charlie Marsh 9897f81cf3 Bump version to 0.0.141 2022-11-26 16:33:08 -05:00
Charlie Marsh 14cf36f922 Bump version to 0.0.140 2022-11-26 15:05:46 -05:00
Charlie Marsh 560558b814 Bump version to 0.0.139 2022-11-25 18:38:26 -05:00
Charlie Marsh 0b60242fb7 Bump version to 0.0.138 2022-11-25 00:05:41 -05:00
Charlie Marsh 65b77feeb8 Bump LibCST version 2022-11-25 00:05:03 -05:00
CelebrateVC a3af6c1ea5
Implement GlobSet optimization for file path exclusions (#883) 2022-11-24 22:31:55 -05:00
Charlie Marsh 68668a584b Bump version to 0.0.137 2022-11-23 20:28:45 -05:00
Charlie Marsh 58aac21a36 Bump version to 0.0.136 2022-11-23 17:41:17 -05:00
Charlie Marsh 66975876b2 Bump version to 0.0.135 2022-11-22 19:21:53 -05:00
Charlie Marsh 59615486d8 Bump version to 0.0.134 2022-11-21 16:15:23 -05:00
Charlie Marsh 0b9188011b Bump version to 0.0.133 2022-11-21 13:39:37 -05:00
Charlie Marsh f8b49f308d
Upgrade RustPython (#855) 2022-11-21 13:20:03 -05:00
Charlie Marsh 38f896502a Bump version to 0.0.132 2022-11-20 18:10:13 -05:00
Charlie Marsh 965918744b
Replace FNV with rustc-hash (#837) 2022-11-20 15:38:31 -05:00
Charlie Marsh 6b4aedb366 Bump version to 0.0.131 2022-11-20 13:40:58 -05:00
Charlie Marsh 9f9a545c51
Improve cache performance by removing `cacache` dependency (#833) 2022-11-20 13:36:33 -05:00
Charlie Marsh 529513bf02
Add CACHEDIR.TAG to .ruff_cache (#830) 2022-11-20 10:53:31 -05:00
Charlie Marsh 124782771f Bump version to 0.0.130 2022-11-20 10:37:19 -05:00
Charlie Marsh 4be09b45ea Bump version to 0.0.129 2022-11-19 19:52:40 -05:00
Charlie Marsh 89afc9db74 Bump version to 0.0.128 2022-11-18 18:50:03 -05:00
Harutaka Kawamura e81efa5a3d
Implement a `--show-source` setting (#698) 2022-11-18 14:02:29 -05:00
Charlie Marsh 49559da54e Bump version to 0.0.127 2022-11-18 13:31:22 -05:00
Charlie Marsh 6a6f4651aa Bump version to 0.0.126 2022-11-17 17:19:19 -05:00
Charlie Marsh aafddae644 Bump version to 0.0.125 2022-11-17 12:07:05 -05:00
Charlie Marsh 90bfc4ec4d Bump version to 0.0.124 2022-11-16 12:25:24 -05:00
Charlie Marsh 8ec14e7ee2 Bump version to 0.0.123 2022-11-16 12:06:01 -05:00
Charlie Marsh 2c89a19f76 Bump Ruff version to 0.0.122 2022-11-15 22:03:46 -05:00
Charlie Marsh 9d136de55a Bump version to 0.0.121 2022-11-15 16:18:39 -05:00
Charlie Marsh 4d798512b1
Only print version checks on tty (#761) 2022-11-15 15:36:06 -05:00
Charlie Marsh 3c22913470 Bump version to 0.0.120 2022-11-14 22:53:36 -05:00
Charlie Marsh 058a5276b0 Bump version to 0.0.119 2022-11-14 21:45:41 -05:00
Charlie Marsh fea029ae35 Bump version to 0.0.118 2022-11-14 13:21:27 -05:00
Charlie Marsh 71f727c380
Use FNV hasher in more places (#732) 2022-11-13 23:44:16 -05:00
Charlie Marsh 08ca8788a7 Bump version to 0.0.117 2022-11-13 16:10:29 -05:00
Charlie Marsh a310aed128 Bump version to 0.0.116 2022-11-13 13:46:05 -05:00
Charlie Marsh 695b06ba60 Bump version to 0.0.115 2022-11-12 16:46:26 -05:00
Charlie Marsh 8cfc0e5cf5
Use FnvHasher for unordered maps and sets (#708) 2022-11-12 16:09:34 -05:00
Charlie Marsh da9ae6a42a Bump version to 0.0.114 2022-11-12 11:55:18 -05:00
Anders Kaseorg 394af0dcff
Disable default features of chrono (#696) 2022-11-12 09:02:02 -05:00
Charlie Marsh a21fe716f2 Bump version to 0.0.113 2022-11-11 22:42:02 -05:00
Charlie Marsh 2e7878ff48 Bump version to 0.0.112 2022-11-11 17:13:04 -05:00
Charlie Marsh 560c00ff9d Bump version to 0.0.111 2022-11-11 12:38:23 -05:00
Charlie Marsh befe64a10e
Support `isort: skip`, `isort: on`, and `isort: off` (#678) 2022-11-11 12:38:01 -05:00
Charlie Marsh 8cf745045f Bump version to 0.0.110 2022-11-10 19:22:45 -05:00
Charlie Marsh 9d8cd2d2fe Bump version to 0.0.109 2022-11-10 10:54:27 -05:00
Charlie Marsh 6c17670aa5
Upgrade LibCST and other crates (#663) 2022-11-08 17:42:12 -05:00
Reiner Gerecke f40609f524
Implement autofix for C413 (#661) 2022-11-08 16:12:29 -05:00
Charlie Marsh f572acab30 Bump version to 0.0.108 2022-11-08 13:20:35 -05:00
Charlie Marsh d600650214
Upgrade RustPython (#652) 2022-11-07 21:07:49 -05:00
Charlie Marsh 43383bb696 Bump version to 0.0.107 2022-11-07 16:39:03 -05:00
Charlie Marsh 16c5ac1e91 Bump version to 0.0.106 2022-11-07 15:32:54 -05:00
Charlie Marsh 7f77ed0f86 Bump version to 0.0.105 2022-11-06 21:17:00 -05:00
Charlie Marsh 050f34dd25 Bump version to 0.0.104 2022-11-06 15:31:10 -05:00
Charlie Marsh 22cfd03b13 Bump ruff_dev to v0.0.103 2022-11-05 19:53:27 -04:00
Charlie Marsh 21479a151d Bump ruff_dev to v0.0.102 2022-11-05 16:00:24 -04:00
Charlie Marsh 6741ea9790
Create a separate dev crate for development scripts (#607) 2022-11-05 15:59:18 -04:00
Charlie Marsh b335a6a5ec Bump version to 0.0.102 2022-11-05 14:13:02 -04:00
Charlie Marsh 0c8b981216 Bump version to 0.0.101 2022-11-04 14:46:48 -04:00
Charlie Marsh 34c91224d7 Bump version to 0.0.100 2022-11-04 12:10:17 -04:00