Commit Graph

624 Commits

Author SHA1 Message Date
Calum Young f0f4bf2929
Move typos to pre-commit config (#4148) 2023-04-29 12:13:35 -04:00
Calum Young ab65eaea7f
Add docs build validation stage to CI (#4116)
Nice. Thank you
2023-04-26 14:57:59 +01:00
konstin 19d8913e32
Use musl in ecosystem docker (#3998)
This prevents errors when the host glibc is newer than the one in the docker container
2023-04-26 05:54:53 +02:00
Jonathan Plasse f3f9a9f297
Fix pre-commit CI job exit code (#3833) 2023-03-31 14:47:04 -04:00
konstin 13e52b1f76
Use cache in cargo udeps CI (#3809) 2023-03-31 11:07:14 -04:00
Jonathan Plasse fec4fa39a7
Improve `add_rule.py` and `add_plugin.py` scripts (#3725) 2023-03-25 16:05:39 +00:00
Jonathan Plasse b8ae1e0e05
Add `pre-commit` in CI (#3707) 2023-03-24 17:20:13 -04:00
Jonathan Plasse 3ec1ea8ac2
Add cargo-udeps in CI (#3646) 2023-03-22 15:53:12 +01:00
Jonathan Plasse c42f8b93d2
Add Swatinem/rust-cache to benchmark-compare job (#3637) 2023-03-21 14:45:09 +01:00
Micha Reiser 404504ab41
CI Checks: Fix malformed markdown (#3595)
The Benchmark results aren't formatted properly if the ecosystem check finds differences because the ecosystem check doesn't emit a trailing newline.

This PR adds the trailing newline to the ecosystem check script.
2023-03-18 10:04:50 +00:00
Micha Reiser aa51ecedc5
ci: Benchmark CI Step (#3480) 2023-03-16 09:05:10 +01:00
Micha Reiser de1106b95a
Allow dispatching the PR comment job for testing (#3535) 2023-03-15 09:34:53 +01:00
Xuehai Pan 8c7317eb8d
ci: fix missing short tag for cloudflare/wrangler-action (#3513) 2023-03-14 15:16:09 +00:00
Xuehai Pan 78c2b0ac47
ci: add dependabot integration for GitHub Actions (#3504) 2023-03-14 10:31:26 -04:00
Samuel Cormier-Iijima 3a7bdb39c9
Fix base ref determination for artifact download in ecosystem CI check (#3499) 2023-03-13 22:37:12 -04:00
Samuel Cormier-Iijima cfa2924664
Setup ecosystem CI (#3390)
This PR sets up an "ecosystem" check as an optional part of the CI step for pull requests. The primary piece of this is a new script in `scripts/check_ecosystem.py` which takes two ruff binaries as input and compares their outputs against a corpus of open-source code in parallel. I used ruff's `text` reporting format and stdlib's `difflib` (rather than JSON output and jsondiffs) to avoid adding another dependency. There is a new ecosystem-comment workflow to add a comment to the PR (see [this link](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) which explains why it needs to be done as a new workflow for security reasons).
2023-03-10 17:39:07 -05:00
Micha Reiser 229f1c34cb
refactor: Extract `ruff_wasm` (#3401) 2023-03-09 10:07:39 +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
konstin d1288dc2b1
Remove maturin build from CI (#3322)
maturin build generally works when cargo build works, so imho it's not worth running it with every CI run.
2023-03-03 16:50:26 +01:00
Charlie Marsh 187104e396
Flag out-of-date docs on CI (#3309) 2023-03-02 15:55:39 -05:00
messense 08e9d12137
Upload `ruff` binaries to GitHub release (#2930) 2023-02-15 12:07:47 -05:00
messense 028c7855b2
Simplify release workflows (#2913)
* No need to build for PyPy since it only contains a binary so the platform tag is the same as CPython
* Update `maturin-action` location
2023-02-15 08:15:19 -05:00
Martin Fischer 02285c18d1 Remove autogenerated docs/rules/*.md files 2023-02-13 19:34:06 -05:00
Charlie Marsh 67198ce7b3 Revert "Run release on tag creation"
This reverts commit c21a5912b9.
2023-02-12 23:11:31 -05:00
Charlie Marsh c21a5912b9 Run release on tag creation 2023-02-12 22:33:01 -05:00
trag1c b8835c2e35
Added MkDocs section to CONTRIBUTING.md (#2803) 2023-02-12 16:07:24 +00:00
Charlie Marsh ac4e212ed2
Move Wasm clippy to its own job (#2789) 2023-02-12 02:41:28 +00:00
Charlie Marsh 9b0a160239
Only update docs on release (#2755) 2023-02-10 22:14:50 -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
Aarni Koskela 38addbe50d
Soft-deprecate update_check (#2530) 2023-02-03 11:33:38 -05:00
Charlie Marsh b5ac93d2ee
Move Clippy configuration to config.toml (#2541) 2023-02-03 09:26:36 -05:00
Jonathan Plasse bdcab87d2f
Add `markdownlint` and dev Ruff to `pre-commit` (#2303) 2023-02-02 16:29:07 -05:00
messense 1e325edfb1
Configure automatically generated release notes (#2341) 2023-01-30 07:21:29 -05:00
Charlie Marsh 0362cc1098 Allow manual trigger for docs 2023-01-28 10:24:52 -05:00
Charlie Marsh 071e3fd196
Split MkDocs site into multiple pages (#2296) 2023-01-28 08:31:16 -05:00
Charlie Marsh eaac3cae5e
Add MkDocs version of README (#2287)
Co-authored-by: Justin Flannery <juftin@juftin.com>
2023-01-27 22:57:42 -05:00
Charlie Marsh b692921160
Use rustup show in lieu of actions-rs/toolchain (#2280) 2023-01-27 18:51:41 -05:00
Charlie Marsh 0b34ca7107
Move off nightly Rust for dev workflows (#2278) 2023-01-27 18:35:19 -05:00
Simon Brugman 5835d719c4 ci: enable windows testing in Github Actions 2023-01-25 18:00:39 -05:00
Anders Kaseorg 823f1c5b6a
Avoid duplicate CI runs triggered by pushes to pull requests (#2178)
https://github.com/charliermarsh/ruff/pull/2157#discussion_r1087179996

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2023-01-25 17:45:07 -05:00
Charlie Marsh 6ede030700 Allow manual releases for pre-release testing 2023-01-25 16:37:04 -05:00
Hugo van Kemenade 233415921b Add colour to CI for readability 2023-01-25 15:21:10 -05:00
Hugo van Kemenade 81141e2a73 Bump GitHub Actions 2023-01-25 15:21:10 -05:00
Hugo van Kemenade 6e255ad53c Allow testing feature branches 2023-01-25 15:21:10 -05:00
Simon Brugman 28f05aa6e7
feat: update scripts to new rules structure (#2078)
- optional `prefix` argument for `add_plugin.py`
- rules directory instead of `rules.rs`
- pathlib syntax
- fix test case where code was added instead of name

Example:
```
python scripts/add_plugin.py --url https://pypi.org/project/example/1.0.0/ example --prefix EXA
python scripts/add_rule.py --name SecondRule --code EXA002 --linter example
python scripts/add_rule.py --name FirstRule --code EXA001 --linter example
python scripts/add_rule.py --name ThirdRule --code EXA003 --linter example
 ```

Note that it breaks compatibility with 'old style' plugins (generation works fine, but namespaces need to be changed):
```
python scripts/add_rule.py --name DoTheThing --code PLC999 --linter pylint
```
2023-01-21 19:19:58 -05:00
Martin Fischer 7fc42f8f85 refactor: Rename RuleOrigin to Linter
"origin" was accurate since ruff rules are currently always modeled
after one origin (except the Ruff-specific rules).

Since we however want to introduce a many-to-many mapping between codes
and rules, the term "origin" no longer makes much sense. Rules usually
don't have multiple origins but one linter implements a rule first and
then others implement it later (often inspired from another linter).
But we don't actually care much about where a rule originates from when
mapping multiple rule codes to one rule implementation, so renaming
RuleOrigin to Linter is less confusing with the many-to-many system.
2023-01-20 20:25:57 -05:00
Martin Fischer 8693236f9e Make CI test add_*.py scripts 2023-01-20 08:09:54 -05:00
Martin Fischer 4061eeeb32 Update CI to use MSRV for cargo test and build
As per Cargo.toml our minimal supported Rust version is 1.65.0, so we
should be using that version in our CI for cargo test and cargo build.

This was apparently accidentally changed in
79ca66ace5.
2023-01-20 07:39:40 -05:00
Charlie Marsh 8891e2e62b Fix name of ruff-pre-commit event 2023-01-17 17:25:02 -05:00
Paul Barrett 019ecc4add
Trigger update to pre-commit mirror after pypi publish (#1910) 2023-01-16 13:14:18 -05:00
Martin Fischer 4470d7ba04
Make the CI check for broken links in the Rust docs (#1883) 2023-01-14 23:18:17 -05:00
Martin Fischer 7b1ce72f86
Actually fix wasm-pack build command (#1862)
I initially attempted to run `wasm-pack build -p ruff` which gave the
error message:

Error: crate directory is missing a `Cargo.toml` file; is `-p` the wrong
directory?

I interpreted that as wasm-pack looking for the "ruff" directory because
I specified -p ruff, however actually the wasm-pack build usage is:

    wasm-pack build [FLAGS] [OPTIONS] <path> <cargo-build-options>

And I was missing the `<path>` argument. So this actually wasn't at all
a bug in wasm-pack but just a confusing error message. And the symlink
hack I introduced in the previous commit didn't actually work ... I only
accidentally omitted the `-p` when testing (which ended up as `ruff`
being the <path> argument) ... CLIs are fun.
2023-01-13 23:20:20 -05:00
Martin Fischer 156e09536e
Add workaround for wasm-pack bug to fix the playground CI (#1861)
Fixes #1860.
2023-01-13 22:46:51 -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 643cedb200
Move CONTRIBUTING.md to top-level (#1768) 2023-01-10 07:38:12 -05:00
Charlie Marsh 91620c378a
Disable release builds on CI (#1761) 2023-01-10 07:33:03 -05:00
Charlie Marsh e4fad70a57
Update documentation to match latest terminology (#1760)
Closes #1759.
2023-01-09 21:10:47 -05:00
Mohamed Daahir 0ee37aa0aa
Cache build artifacts using Swatinem/rust-cache@v1 (#1750)
This GitHub Action caches build artifacts in addition to dependencies
which halves the CI duration time.

Resolves #1752.
2023-01-09 15:35:32 -05:00
Charlie Marsh 7d24146df7
Implement `--isolated` CLI flag (#1727)
Closes #1724.
2023-01-07 18:43:58 -05:00
Charlie Marsh bdb9a4d1a7
Update CONTRIBUTING.md to point to violations.rs (#1720) 2023-01-07 15:20:21 -05:00
Charlie Marsh 5ed58ae595
Add requested context to issue template (#1679) 2023-01-06 07:29:08 -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
messense 6a1edeb694
Cancel outdated in-progress workflow automatically (#1652) 2023-01-04 22:03:26 -05:00
Charlie Marsh 8647bec3cb
Rename checks.rs to registry.rs (#1566) 2023-01-02 17:26:51 -05:00
Colin Delahunty e9be5fc7be
Add typo linter (#1553) 2023-01-02 15:57:59 -05:00
Harutaka Kawamura e3867b172d
Simplify unused snapshot check (#1525) 2023-01-01 02:43:07 -05:00
Harutaka Kawamura 926b5494ad
Remove unused snapshots (#1497) 2022-12-31 07:40:38 -05:00
Charlie Marsh 3ee20a70d3 Remove lingering ruff_options.ts references 2022-12-30 15:33:09 -05:00
Charlie Marsh d16ba890ae
Turn off wasm-pack tests (#1427) 2022-12-28 12:55:25 -05:00
Charlie Marsh 4521fdf021 Only test --lib for wasm-pack 2022-12-28 10:28:40 -05:00
Charlie Marsh 2a11c4b1f1 Try increasing wasm-bindgen timeout 2022-12-28 07:39:23 -05:00
Charlie Marsh 0a60eb0aca
Fix invalid reference to ruff_options.rs (#1409) 2022-12-27 12:12:28 -05:00
Charlie Marsh b4dbe62da0
Add cargo +nightly dev generate-all (#1404) 2022-12-27 10:07:18 -05:00
Charlie Marsh e692c4a2cc
Tweak secret detection for playground releases (#1402) 2022-12-27 08:41:53 -05:00
Charlie Marsh 018b9a2977
Only run playground release in main repo (#1396) 2022-12-26 19:45:04 -05:00
Charlie Marsh 20d6b21d77
Add ESLint, Prettier, and TypeScript checks (#1384) 2022-12-26 15:08:22 -05:00
Charlie Marsh 1a27992f47
Enable preview deployments for playground (#1383) 2022-12-26 14:52:13 -05:00
Charlie Marsh 89cebe1ce2 Update name of Playground job 2022-12-26 12:10:22 -05:00
Reiner Gerecke bdb1505262
Web playground with WASM (#1279) 2022-12-26 12:09:17 -05:00
Edgar R. M 4888afd423
Generate JSON schema for Ruff options (#1329) 2022-12-24 14:10:22 -05:00
Charlie Marsh 74f49eda64
Bump compatibility to 3.11 (#1352) 2022-12-23 12:12:11 -05:00
Anders Kaseorg 20ac823778
generate-check-code-prefix: Run `rustfmt` automatically; only write if changed (#1282) 2022-12-18 17:46:23 -05:00
Reiner Gerecke a000cd4a09
Test to prevent continious reformatting when used together with black (#1206) 2022-12-15 15:26:41 -05:00
Reiner Gerecke 38141a6f14
Check for outdated auto-generated files in CI (#1192) 2022-12-11 10:18:57 -05:00
Charlie Marsh db815a565f
Run release job on release: published event (#1156) 2022-12-08 23:05:28 -05:00
Charlie Marsh 72a9bd3cfb Revert "Upload wheels back to GitHub Releases (#884)"
This reverts commit bd08fc359d.
2022-11-23 20:27:33 -05:00
Charlie Marsh bd08fc359d
Upload wheels back to GitHub Releases (#884) 2022-11-23 00:06:36 -05:00
Charlie Marsh bdd32c0850
Enforce most pedantic lints on CI (#878) 2022-11-22 18:55:57 -05:00
messense 3f597a3b30
Upgrade maturin to 0.14 (#846) 2022-11-21 10:00:14 -05:00
Charlie Marsh 63d63e8c12
Increase retry counts in GitHub Actions workflows (#763) 2022-11-15 17:21:16 -05:00
Anders Kaseorg 450970e0e6
Restore clippy on all crates in the workspace (#725) 2022-11-13 15:18:57 -05:00
Harutaka Kawamura 43cc8bc84e
Lint test code (#721) 2022-11-13 11:55:57 -05:00
Charlie Marsh 937c83d57f
Remove crates subdirectory (#563) 2022-11-03 09:19:54 -04:00
Charlie Marsh 017fec2bc5
Set override in actions-rs/toolchain@v1 (#543) 2022-11-02 09:36:22 -04:00
Charlie Marsh 878a94f9cb
Add a rust-toolchain.toml file (#538) 2022-11-01 20:34:58 -04:00
Charlie Marsh 79ca66ace5
Use nightly rustfmt with rustfmt.toml (#536) 2022-11-01 20:34:38 -04:00
Charlie Marsh 927d716edd Enable flake8-to-ruff builds on all platforms 2022-11-01 12:15:43 -04:00
Charlie Marsh df6a48fced Use separate tokens for each PyPI release 2022-10-31 22:43:38 -04:00
Charlie Marsh 91a8277ac0 Always release flake8-to-ruff 2022-10-31 22:16:28 -04:00
Charlie Marsh 5aa8455258 Misc. improvements to flake8-to-ruff 2022-10-31 18:38:47 -04:00
Charlie Marsh 5de1fcd653 Add to flake8-to-ruff README 2022-10-31 17:50:32 -04:00
Charlie Marsh 032f4f3f12 Set maturin path when building flake8-to-ruff 2022-10-31 16:49:45 -04:00
Charlie Marsh 05867ef260 Set flake8-to-ruff release to workflow_dispatch 2022-10-31 16:25:09 -04:00
Charlie Marsh 0cd8b75f06 Rename release.yaml files 2022-10-31 16:23:52 -04:00
Charlie Marsh 5f07e1d6b5 Fix release.yaml task names 2022-10-31 16:22:25 -04:00
Charlie Marsh 1ce4585c88
Add a separate release job for flake8-to-ruff (#529) 2022-10-31 16:21:38 -04:00
Charlie Marsh f3f010cdf5
Move flake8-to-ruff to a separate crate (#528) 2022-10-31 14:22:07 -04:00
Adrian Garcia Badaracco b1c40d5fa7
Run MacOS builds in parallel (#171) 2022-09-12 16:24:13 -04:00
Charlie Marsh 2749660b1f
Disable update-informer on linux-cross (#113) 2022-09-06 14:19:38 -04:00
Nikita Sobolev 741857cdf9
Use the latest version of `actions/checkout` (#79) 2022-09-01 13:18:31 -04:00
Kian-Meng Ang b442402b13
Prettify md/yaml files (#74) 2022-09-01 12:36:47 -04:00
Charlie Marsh 875e812188 Disable build-on-push for now 2022-08-31 10:45:41 -04:00
Adrian Garcia Badaracco e16fd39bb5
Build on every push but only publish on tags (#46) 2022-08-30 13:19:36 -04:00
Charlie Marsh 53554a2bf1 Remove lint step from release.yaml 2022-08-30 09:16:35 -04:00
Adrian Garcia Badaracco bd0ed1b96c
Build ABI3 wheels and expand supported platforms (#45) 2022-08-30 09:16:07 -04:00
Charlie Marsh 5dd53dcf88 Fix 3.10 reference in release.yaml 2022-08-29 22:01:26 -04:00
Charlie Marsh 07ed1e3b01 Cut abi3-compatible wheels 2022-08-29 21:57:47 -04:00
Charlie Marsh b1b507ed29 Minor updates to the workflow file 2022-08-29 17:40:56 -04:00
Charlie Marsh 37401bdfb0
Build wheels for Linux (#42) 2022-08-29 17:13:08 -04:00
Charlie Marsh c52fdfa748
Rename to ruff (#29) 2022-08-27 18:30:30 -04:00
Charlie Marsh 4a67c8d44b
Add unit tests for linter (#9) 2022-08-13 17:32:40 -04:00
Charlie Marsh 201ccc83b1
Cache Cargo registry on GitHub Actions (#3) 2022-08-10 16:41:46 -04:00
Charlie Marsh c35940b014
Add a GitHub Action (#2) 2022-08-10 16:18:33 -04:00