ruffly-all 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ruffly_all-0.2.0/.github/workflows/publish-python.yml +164 -0
- ruffly_all-0.2.0/.github/workflows/publish-rust.yml +21 -0
- ruffly_all-0.2.0/.github/workflows/rust.yml +23 -0
- ruffly_all-0.2.0/.gitignore +1 -0
- ruffly_all-0.2.0/Cargo.lock +54 -0
- ruffly_all-0.2.0/Cargo.toml +12 -0
- ruffly_all-0.2.0/PKG-INFO +18 -0
- ruffly_all-0.2.0/README.md +9 -0
- ruffly_all-0.2.0/pyproject.toml +17 -0
- ruffly_all-0.2.0/src/main.rs +51 -0
- ruffly_all-0.2.0/src/ruff_code.rs +33 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# This file is autogenerated by maturin v1.9.6
|
|
2
|
+
# To update, run
|
|
3
|
+
#
|
|
4
|
+
# maturin generate-ci github
|
|
5
|
+
#
|
|
6
|
+
name: CI
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
push:
|
|
10
|
+
branches:
|
|
11
|
+
- main
|
|
12
|
+
- master
|
|
13
|
+
tags:
|
|
14
|
+
- v[0-9]+.[0-9]+.[0-9]+
|
|
15
|
+
pull_request:
|
|
16
|
+
workflow_dispatch:
|
|
17
|
+
|
|
18
|
+
permissions:
|
|
19
|
+
contents: read
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
linux:
|
|
23
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
24
|
+
strategy:
|
|
25
|
+
matrix:
|
|
26
|
+
platform:
|
|
27
|
+
- runner: ubuntu-22.04
|
|
28
|
+
target: x86_64
|
|
29
|
+
- runner: ubuntu-22.04
|
|
30
|
+
target: x86
|
|
31
|
+
- runner: ubuntu-22.04
|
|
32
|
+
target: aarch64
|
|
33
|
+
- runner: ubuntu-22.04
|
|
34
|
+
target: armv7
|
|
35
|
+
- runner: ubuntu-22.04
|
|
36
|
+
target: s390x
|
|
37
|
+
- runner: ubuntu-22.04
|
|
38
|
+
target: ppc64le
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v4
|
|
41
|
+
- name: Build wheels
|
|
42
|
+
uses: PyO3/maturin-action@v1
|
|
43
|
+
with:
|
|
44
|
+
target: ${{ matrix.platform.target }}
|
|
45
|
+
args: --release --out dist
|
|
46
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
47
|
+
manylinux: auto
|
|
48
|
+
- name: Upload wheels
|
|
49
|
+
uses: actions/upload-artifact@v4
|
|
50
|
+
with:
|
|
51
|
+
name: wheels-linux-${{ matrix.platform.target }}
|
|
52
|
+
path: dist
|
|
53
|
+
|
|
54
|
+
musllinux:
|
|
55
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
56
|
+
strategy:
|
|
57
|
+
matrix:
|
|
58
|
+
platform:
|
|
59
|
+
- runner: ubuntu-22.04
|
|
60
|
+
target: x86_64
|
|
61
|
+
- runner: ubuntu-22.04
|
|
62
|
+
target: x86
|
|
63
|
+
- runner: ubuntu-22.04
|
|
64
|
+
target: aarch64
|
|
65
|
+
- runner: ubuntu-22.04
|
|
66
|
+
target: armv7
|
|
67
|
+
steps:
|
|
68
|
+
- uses: actions/checkout@v4
|
|
69
|
+
- name: Build wheels
|
|
70
|
+
uses: PyO3/maturin-action@v1
|
|
71
|
+
with:
|
|
72
|
+
target: ${{ matrix.platform.target }}
|
|
73
|
+
args: --release --out dist
|
|
74
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
75
|
+
manylinux: musllinux_1_2
|
|
76
|
+
- name: Upload wheels
|
|
77
|
+
uses: actions/upload-artifact@v4
|
|
78
|
+
with:
|
|
79
|
+
name: wheels-musllinux-${{ matrix.platform.target }}
|
|
80
|
+
path: dist
|
|
81
|
+
|
|
82
|
+
windows:
|
|
83
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
84
|
+
strategy:
|
|
85
|
+
matrix:
|
|
86
|
+
platform:
|
|
87
|
+
- runner: windows-latest
|
|
88
|
+
target: x64
|
|
89
|
+
- runner: windows-latest
|
|
90
|
+
target: x86
|
|
91
|
+
steps:
|
|
92
|
+
- uses: actions/checkout@v4
|
|
93
|
+
- name: Build wheels
|
|
94
|
+
uses: PyO3/maturin-action@v1
|
|
95
|
+
with:
|
|
96
|
+
target: ${{ matrix.platform.target }}
|
|
97
|
+
args: --release --out dist
|
|
98
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
99
|
+
- name: Upload wheels
|
|
100
|
+
uses: actions/upload-artifact@v4
|
|
101
|
+
with:
|
|
102
|
+
name: wheels-windows-${{ matrix.platform.target }}
|
|
103
|
+
path: dist
|
|
104
|
+
|
|
105
|
+
macos:
|
|
106
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
107
|
+
strategy:
|
|
108
|
+
matrix:
|
|
109
|
+
platform:
|
|
110
|
+
- runner: macos-14
|
|
111
|
+
target: aarch64
|
|
112
|
+
steps:
|
|
113
|
+
- uses: actions/checkout@v4
|
|
114
|
+
- name: Build wheels
|
|
115
|
+
uses: PyO3/maturin-action@v1
|
|
116
|
+
with:
|
|
117
|
+
target: ${{ matrix.platform.target }}
|
|
118
|
+
args: --release --out dist
|
|
119
|
+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
120
|
+
- name: Upload wheels
|
|
121
|
+
uses: actions/upload-artifact@v4
|
|
122
|
+
with:
|
|
123
|
+
name: wheels-macos-${{ matrix.platform.target }}
|
|
124
|
+
path: dist
|
|
125
|
+
|
|
126
|
+
sdist:
|
|
127
|
+
runs-on: ubuntu-latest
|
|
128
|
+
steps:
|
|
129
|
+
- uses: actions/checkout@v4
|
|
130
|
+
- name: Build sdist
|
|
131
|
+
uses: PyO3/maturin-action@v1
|
|
132
|
+
with:
|
|
133
|
+
command: sdist
|
|
134
|
+
args: --out dist
|
|
135
|
+
- name: Upload sdist
|
|
136
|
+
uses: actions/upload-artifact@v4
|
|
137
|
+
with:
|
|
138
|
+
name: wheels-sdist
|
|
139
|
+
path: dist
|
|
140
|
+
|
|
141
|
+
release:
|
|
142
|
+
name: Release
|
|
143
|
+
runs-on: ubuntu-latest
|
|
144
|
+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
|
|
145
|
+
needs: [linux, musllinux, windows, macos, sdist]
|
|
146
|
+
permissions:
|
|
147
|
+
# Use to sign the release artifacts
|
|
148
|
+
id-token: write
|
|
149
|
+
# Used to upload release artifacts
|
|
150
|
+
contents: write
|
|
151
|
+
# Used to generate artifact attestation
|
|
152
|
+
attestations: write
|
|
153
|
+
steps:
|
|
154
|
+
- uses: actions/download-artifact@v4
|
|
155
|
+
# - name: Generate artifact attestation
|
|
156
|
+
# uses: actions/attest-build-provenance@v2
|
|
157
|
+
# with:
|
|
158
|
+
# subject-path: 'wheels-*/*'
|
|
159
|
+
- name: Publish to PyPI
|
|
160
|
+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
161
|
+
uses: PyO3/maturin-action@v1
|
|
162
|
+
with:
|
|
163
|
+
command: upload
|
|
164
|
+
args: --non-interactive --skip-existing wheels-*/*
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
tags:
|
|
5
|
+
- v[0-9]+.[0-9]+.[0-9]+
|
|
6
|
+
jobs:
|
|
7
|
+
Publish:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
container:
|
|
10
|
+
image: rust:latest
|
|
11
|
+
steps:
|
|
12
|
+
- name: Checkout repository
|
|
13
|
+
uses: actions/checkout@v6
|
|
14
|
+
- name: Install toml-cli
|
|
15
|
+
run: cargo install toml-cli
|
|
16
|
+
- name: Check version
|
|
17
|
+
run: test "v$(toml get -r Cargo.toml package.version)" = "${{ github.ref_name }}"
|
|
18
|
+
- name: Publish
|
|
19
|
+
run: cargo publish
|
|
20
|
+
env:
|
|
21
|
+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: Rust
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ "main" ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ "main" ]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v6
|
|
19
|
+
- name: Build
|
|
20
|
+
run: cargo build --verbose
|
|
21
|
+
- name: Run tests
|
|
22
|
+
run: cargo test --verbose
|
|
23
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/target
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "aho-corasick"
|
|
7
|
+
version = "1.1.4"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"memchr",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
[[package]]
|
|
15
|
+
name = "memchr"
|
|
16
|
+
version = "2.7.6"
|
|
17
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
18
|
+
checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
|
|
19
|
+
|
|
20
|
+
[[package]]
|
|
21
|
+
name = "regex"
|
|
22
|
+
version = "1.12.3"
|
|
23
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
24
|
+
checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276"
|
|
25
|
+
dependencies = [
|
|
26
|
+
"aho-corasick",
|
|
27
|
+
"memchr",
|
|
28
|
+
"regex-automata",
|
|
29
|
+
"regex-syntax",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[[package]]
|
|
33
|
+
name = "regex-automata"
|
|
34
|
+
version = "0.4.14"
|
|
35
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
36
|
+
checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f"
|
|
37
|
+
dependencies = [
|
|
38
|
+
"aho-corasick",
|
|
39
|
+
"memchr",
|
|
40
|
+
"regex-syntax",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[[package]]
|
|
44
|
+
name = "regex-syntax"
|
|
45
|
+
version = "0.8.9"
|
|
46
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
47
|
+
checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c"
|
|
48
|
+
|
|
49
|
+
[[package]]
|
|
50
|
+
name = "ruffly-all"
|
|
51
|
+
version = "0.2.0"
|
|
52
|
+
dependencies = [
|
|
53
|
+
"regex",
|
|
54
|
+
]
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "ruffly-all"
|
|
3
|
+
version = "0.2.0"
|
|
4
|
+
edition = "2024"
|
|
5
|
+
repository = "https://github.com/AiyionPrime/ruffly-all"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
authors = ["Burfeind, Jan-Niklas <jan-niklas.burfeind@sennheiser.com>"]
|
|
8
|
+
description = "Generating a migration path to ruff from anywhere"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
|
|
11
|
+
[dependencies]
|
|
12
|
+
regex = "1.12.3"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ruffly-all
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Requires-Dist: ruff>=0.15.0
|
|
5
|
+
Summary: A small tool generating a migration path to ruff from anywhere.
|
|
6
|
+
Requires-Python: >=3.13
|
|
7
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
8
|
+
|
|
9
|
+
# that's ruffly-all
|
|
10
|
+
|
|
11
|
+
## Answering whats necessary to migrate your project to ruff right now.
|
|
12
|
+
|
|
13
|
+
### A glorified version of this oneliner
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ruff check --isolated --select 'ALL' --output-format concise 2>/dev/null | cut -d ' ' -f2 | grep '^[A-Za-z]' | sort | tr -d '0123456789' | uniq"
|
|
17
|
+
```
|
|
18
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# that's ruffly-all
|
|
2
|
+
|
|
3
|
+
## Answering whats necessary to migrate your project to ruff right now.
|
|
4
|
+
|
|
5
|
+
### A glorified version of this oneliner
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
ruff check --isolated --select 'ALL' --output-format concise 2>/dev/null | cut -d ' ' -f2 | grep '^[A-Za-z]' | sort | tr -d '0123456789' | uniq"
|
|
9
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["maturin>=1.0,<2.0"]
|
|
3
|
+
build-backend = "maturin"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ruffly-all"
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
description = "A small tool generating a migration path to ruff from anywhere."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.13"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"ruff>=0.15.0",
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
[tool.maturin]
|
|
17
|
+
bindings = "bin"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
mod ruff_code;
|
|
2
|
+
|
|
3
|
+
use ruff_code::RuffCode;
|
|
4
|
+
use std::collections::HashSet;
|
|
5
|
+
use std::process::Command;
|
|
6
|
+
use std::str::FromStr;
|
|
7
|
+
|
|
8
|
+
fn main() {
|
|
9
|
+
let output = Command::new("ruff")
|
|
10
|
+
.arg("check")
|
|
11
|
+
.arg("--select")
|
|
12
|
+
.arg("ALL")
|
|
13
|
+
.arg("--output-format")
|
|
14
|
+
.arg("concise")
|
|
15
|
+
.output()
|
|
16
|
+
.expect("failed to execute process");
|
|
17
|
+
let out = String::from_utf8_lossy(&output.stdout);
|
|
18
|
+
|
|
19
|
+
let mut unique_groups = HashSet::new();
|
|
20
|
+
|
|
21
|
+
for line in out.lines() {
|
|
22
|
+
let maybe_code = &line
|
|
23
|
+
.split_whitespace()
|
|
24
|
+
.nth(1)
|
|
25
|
+
.expect("line without second word encountered");
|
|
26
|
+
if maybe_code
|
|
27
|
+
.chars()
|
|
28
|
+
.next()
|
|
29
|
+
.expect("no char")
|
|
30
|
+
.is_ascii_alphabetic()
|
|
31
|
+
&& *maybe_code != "invalid-syntax:"
|
|
32
|
+
&& *maybe_code != "checks"
|
|
33
|
+
{
|
|
34
|
+
let code = RuffCode::from_str(maybe_code).expect("could not parse");
|
|
35
|
+
unique_groups.insert(code.group);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let mut listed: Vec<String> = unique_groups.into_iter().collect();
|
|
40
|
+
listed.sort();
|
|
41
|
+
|
|
42
|
+
println!("[tool.ruff]");
|
|
43
|
+
println!("lint.select = [ ALL ]");
|
|
44
|
+
println!("lint.ignore = [");
|
|
45
|
+
println!(" \"D203\", # incompatible to D211");
|
|
46
|
+
println!(" \"D212\", # incompatible to D213");
|
|
47
|
+
for group in listed {
|
|
48
|
+
println!(" \"{}\",", &group);
|
|
49
|
+
}
|
|
50
|
+
println!("]");
|
|
51
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
extern crate regex;
|
|
2
|
+
|
|
3
|
+
use regex::Regex;
|
|
4
|
+
use std::fmt;
|
|
5
|
+
use std::str::FromStr;
|
|
6
|
+
|
|
7
|
+
#[derive(Debug)]
|
|
8
|
+
pub struct RuffCode {
|
|
9
|
+
pub group: String,
|
|
10
|
+
number: u16,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
#[derive(Debug, PartialEq, Eq)]
|
|
14
|
+
pub struct ParseRuffCodeError;
|
|
15
|
+
|
|
16
|
+
impl fmt::Display for RuffCode {
|
|
17
|
+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
18
|
+
write!(f, "{}{:03}", self.group, self.number)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
impl FromStr for RuffCode {
|
|
23
|
+
type Err = ParseRuffCodeError;
|
|
24
|
+
|
|
25
|
+
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
|
26
|
+
let regex_code: regex::Regex = Regex::new(r"(?m)([A-Z]+)([0-9]+)").unwrap();
|
|
27
|
+
|
|
28
|
+
let matches = regex_code.captures(s).ok_or(ParseRuffCodeError)?;
|
|
29
|
+
let group = matches[1].to_string();
|
|
30
|
+
let number = matches[2].parse::<u16>().map_err(|_| ParseRuffCodeError)?;
|
|
31
|
+
Ok(RuffCode { group, number })
|
|
32
|
+
}
|
|
33
|
+
}
|