Commit 31a76bd
authored
Add black and ruff to fix lint/pep/ and other issues automatically (#634)
Add black and ruff to fix lint/pep/ and other issues automatically
Summary
This PR modernizes and stabilizes the linting and formatting pipeline while keeping OpenStack standards.
What Was Done
Integrated Ruff for:
Import sorting
Unused import removal
General lint auto-fixes (E, F, I rules)
Integrated Black as the canonical code formatter (default line length = 88)
Kept flake8 + hacking to enforce OpenStack-specific standards
Kept doc8 for documentation validation
Updated tox configuration:
pep8 environment → CI check-only (no file modifications)
fix-pep8 environment → local auto-fix (modifies files)
Disabled E501 and E203 in flake8 to avoid conflicts with Black formatting (as recommended by Black documentation)
Why to much files changed
The large diff is intentional.
Black reformatted the entire codebase to a consistent style:
Normalized indentation
Adjusted line wrapping (88 characters)
Standardized slice spacing
Reformatted long imports
Removed trailing whitespace
Applied consistent multiline formatting
Ruff additionally:
Removed unused imports
Sorted imports
Cleaned up minor style inconsistencies
No functional or behavioral changes were introduced.
All changes are formatting and lint normalization only.
Why This Is Beneficial
Eliminates inconsistent formatting across the repository
Reduces CI noise caused by minor style differences
Aligns with modern Python tooling practices
Provides a single command to auto-fix issues locally
CI Behavior
CI now runs linting in read-only mode.
If formatting is incorrect, CI fails without modifying files.
Impact
No runtime changes
No API changes
No test logic changes
Formatting and lint normalization only
Reviewed-by: Anton Sidelnikov1 parent ec4ed0d commit 31a76bd
2,054 files changed
Lines changed: 51285 additions & 55721 deletions
File tree
- doc/source
- contributor/create/examples/resource
- sdk/guides
- examples
- anti_ddos
- apig
- auto_scaling
- baremetal
- cbr
- cce
- ces
- cloud
- clustering
- compute
- css
- ctsv3
- cts
- dcaas
- dcs
- dds
- deh
- dis
- dms
- dns
- dws
- elb
- function_graph
- identity
- image
- ims
- key_manager
- kms
- lts
- modelartsv1
- modelartsv2
- mrs
- natv3
- nat
- network
- obs
- rds
- sfsturbo
- smn
- swr
- tms
- vlb
- vpcep
- vpc
- otcextensions
- common
- osclient
- anti_ddos
- v1
- auto_scaling
- v1
- cbr
- v3
- cce
- v1
- v2
- ces
- v1
- compute/v2
- css
- v1
- cts
- v1
- dcaas
- v2
- dcs
- v1
- deh
- v1
- dis
- v2
- dms
- v1
- dns
- v2
- dws
- v1
- identity
- v3
- kms
- v1
- load_balancer
- v1
- modelartsv1
- v1
- modelartsv2
- v2
- mrs
- v1
- nat
- v2
- obs
- v1
- privatenat
- v3
- rds
- v1
- v3
- sdrs
- v1
- smn
- v2
- vlb
- v3
- volume_backup
- v2
- vpcep
- v1
- vpc
- v2
- sdk
- anti_ddos
- v1
- aomv1
- aomv2
- apig
- v2
- auto_scaling
- v1
- bms
- v1
- cbr
- v3
- cce
- v1
- v3
- ces
- v1
- cfwv1
- v1
- cfwv2
- v2
- cfwv3
- v3
- cloud
- compute/v2
- csbs
- css
- v1
- ctsv2
- v2
- ctsv3
- v3
- cts
- v1
- dataarts
- dcaas
- v2
- dcs
- v1
- ddmv1
- v1
- ddmv2
- v1
- ddmv3
- v1
- dds
- v3
- deh
- v1
- dis
- v2
- dli
- dmsv2
- dms
- v1
- dns
- v2
- drs
- dws
- v1
- ecs
- v1
- elb
- v2
- enterprise_dashboard_v1
- v1
- enterprise_dashboard
- v1
- er
- v3
- evpn
- v5
- function_graph
- v2
- gaussdb
- geminidb
- v3
- hss
- v5
- identity
- v3
- imsv1
- v1
- imsv2
- v2
- kms
- v1
- lts
- v2
- modelartsv1/v1
- modelartsv2/v2
- mrs
- v1
- natv3
- v3
- nat
- v2
- network/v2
- obs
- v1
- ocr
- plas
- rds
- v1
- v3
- rms
- rts
- sdrs
- v1
- sfsturbo
- v1
- smn
- v2
- swr
- v2
- tms
- v1
- vlb
- v3
- volume_backup
- v2
- vpcep
- v1
- vpc
- v1
- vpn
- wafd
- v1
- waf
- v1
- tests
- functional
- osclient
- cbr/v3
- cce/v3
- compute/v2
- dcaas/v2
- dns/v2
- identity/v3
- kms/v1
- nat/v2
- obs/v1
- privatenat/v3
- rds/v3
- volume_backup/v2
- vpc/v1
- sdk
- anti_ddos/v1
- aomv1/v1
- aomv2/v2
- apig
- v2
- auto_scaling/v1
- bms/v1
- cbr/v3
- cce/v1
- ces/v1
- compute/v2
- csbs/v1
- ctsv3/v3
- cts/v1
- dataarts/v1
- dcaas/v2
- dcs/v1
- ddm
- v1
- v2
- v3
- dds/v3
- deh/v1
- dis/v2
- dli/v1
- dms/v1
- dns
- v2
- dws/v1
- elb
- v2
- er/v3
- function_graph
- v2
- gaussdb/v3
- imsv1/v1
- imsv2/v2
- kms/v1
- lts/v2
- modelartsv1/v1
- modelartsv2/v2
- mrs/v1
- natv3/v3
- nat/v2
- obs/v1
- ocr/v2
- plas/v1
- rds/v1
- rts/v2
- sdrs/v1
- sfsturbo/v1
- smn/v2
- swr/v2
- tms/v1
- vlb
- v3
- volume_backup/v2
- vpcep
- v1
- vpc
- v1
- v2
- vpn/v2
- wafd/v1
- waf/v1
- unit
- common
- osclient
- anti_ddos/v1
- auto_scaling/v1
- cbr/v3
- cce
- v1
- v2
- css/v1
- cts/v1
- dcaas/v2
- dcs/v1
- deh/v1
- dis/v2
- dms/v1
- dns/v2
- dws/v1
- identity/v3
- kms/v1
- load_balancer/v1
- modelartsv1/v1
- modelartsv2/v2
- mrs/v1
- nat/v2
- obs/v1
- privatenat/v3
- rds
- v1
- v3
- sdrs/v1
- smn/v2
- vlb/v3
- volume_backup/v2
- vpcep/v1
- vpc/v1
- sdk
- anti_ddos/v1
- apig/v2
- auto_scaling/v1
- bms/v1
- cbr/v3
- cce
- v1
- v3
- ces/v1
- cloud
- compute/v2
- css/v1
- ctsv3/v3
- cts/v1
- dcaas/v2
- dcs/v1
- dds/v3
- deh/v1
- dis/v2
- dms/v1
- dns/v2
- dws/v1
- elb/v2
- function_graph/v2
- identity/v3
- imsv1/v1
- imsv2/v2
- kms/v1
- lts/v2
- modelartsv1/v1
- modelartsv2/v2
- mrs/v1
- natv3/v3
- nat/v2
- obs/v1
- ocr/v2
- plas/v1
- rds
- v1
- v3
- sdrs/v1
- sfsturbo/v1
- smn/v2
- swr/v2
- tms/v1
- vlb/v3
- volume_backup/v2
- vpcep/v1
- vpc/v1
- waf/v1
- releasenotes/source
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
| 28 | + | |
30 | 29 | | |
31 | 30 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
46 | | - | |
| 45 | + | |
47 | 46 | | |
48 | 47 | | |
49 | | - | |
| 48 | + | |
50 | 49 | | |
51 | 50 | | |
52 | | - | |
53 | | - | |
| 51 | + | |
| 52 | + | |
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
| |||
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
62 | | - | |
| 61 | + | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
70 | | - | |
71 | | - | |
| 69 | + | |
72 | 70 | | |
73 | 71 | | |
74 | 72 | | |
| |||
78 | 76 | | |
79 | 77 | | |
80 | 78 | | |
81 | | - | |
| 79 | + | |
82 | 80 | | |
83 | 81 | | |
84 | 82 | | |
| |||
91 | 89 | | |
92 | 90 | | |
93 | 91 | | |
94 | | - | |
| 92 | + | |
95 | 93 | | |
96 | 94 | | |
97 | 95 | | |
98 | 96 | | |
99 | 97 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
111 | | - | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | | - | |
115 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
| 12 | + | |
12 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
95 | | - | |
96 | | - | |
| 97 | + | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
116 | | - | |
117 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| |||
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
131 | | - | |
| 133 | + | |
| 134 | + | |
132 | 135 | | |
133 | 136 | | |
134 | 137 | | |
| |||
0 commit comments