Skip to content

Commit

Permalink
Upgrade Ruff to 0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos committed Jul 13, 2024
1 parent 3adae6c commit 10a0958
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 49 deletions.
1 change: 1 addition & 0 deletions docs/.hooks/render_ruff_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ def run(self, lines): # noqa: PLR6301
'PLR0915',
'PLR0916',
'PLR0917',
'PLR1701',
'PLR1702',
'PLR1706',
'PT004',
Expand Down
2 changes: 1 addition & 1 deletion docs/history/hatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
***Added:***

- Add ability to control the source of Python distributions
- Upgrade Ruff to 0.4.5
- Upgrade Ruff to 0.5.0
- Upgrade PyApp to 0.22.0 for binary builds

***Fixed:***
Expand Down
9 changes: 0 additions & 9 deletions ruff_defaults.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ select = [
"ARG004",
"ARG005",
"ASYNC100",
"ASYNC101",
"ASYNC102",
"B002",
"B003",
"B004",
Expand Down Expand Up @@ -130,7 +128,6 @@ select = [
"E742",
"E743",
"E902",
"E999",
"EM101",
"EM102",
"EM103",
Expand Down Expand Up @@ -323,7 +320,6 @@ select = [
"PLR0203",
"PLR0206",
"PLR0402",
"PLR1701",
"PLR1704",
"PLR1711",
"PLR1714",
Expand Down Expand Up @@ -590,11 +586,6 @@ select = [
"TID251",
"TID252",
"TID253",
"TRIO100",
"TRIO105",
"TRIO109",
"TRIO110",
"TRIO115",
"TRY002",
"TRY003",
"TRY004",
Expand Down
87 changes: 49 additions & 38 deletions src/hatch/cli/fmt/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,16 @@ def get_config(self, section: str) -> dict[str, Any]:
'ARG004',
'ARG005',
'ASYNC100',
'ASYNC101',
'ASYNC102',
'ASYNC105',
'ASYNC109',
'ASYNC110',
'ASYNC115',
'ASYNC210',
'ASYNC220',
'ASYNC221',
'ASYNC222',
'ASYNC230',
'ASYNC251',
'B002',
'B003',
'B004',
Expand Down Expand Up @@ -307,6 +315,17 @@ def get_config(self, section: str) -> dict[str, Any]:
'FBT001',
'FBT002',
'FLY002',
'FURB105',
'FURB129',
'FURB136',
'FURB161',
'FURB163',
'FURB167',
'FURB168',
'FURB169',
'FURB177',
'FURB181',
'FURB187',
'G001',
'G002',
'G003',
Expand Down Expand Up @@ -349,6 +368,7 @@ def get_config(self, section: str) -> dict[str, Any]:
'PERF102',
'PERF401',
'PERF402',
'PERF403',
'PGH005',
'PIE790',
'PIE794',
Expand All @@ -364,9 +384,12 @@ def get_config(self, section: str) -> dict[str, Any]:
'PLC0205',
'PLC0208',
'PLC0414',
'PLC2401',
'PLC2403',
'PLC3002',
'PLE0100',
'PLE0101',
'PLE0115',
'PLE0116',
'PLE0117',
'PLE0118',
Expand All @@ -376,6 +399,9 @@ def get_config(self, section: str) -> dict[str, Any]:
'PLE0307',
'PLE0604',
'PLE0605',
'PLE0643',
'PLE0704',
'PLE1132',
'PLE1142',
'PLE1205',
'PLE1206',
Expand All @@ -394,23 +420,31 @@ def get_config(self, section: str) -> dict[str, Any]:
'PLR0133',
'PLR0206',
'PLR0402',
'PLR1701',
'PLR1704',
'PLR1711',
'PLR1714',
'PLR1722',
'PLR1736',
'PLR2004',
'PLR2044',
'PLR5501',
'PLW0120',
'PLW0127',
'PLW0128',
'PLW0129',
'PLW0131',
'PLW0133',
'PLW0245',
'PLW0406',
'PLW0602',
'PLW0603',
'PLW0604',
'PLW0711',
'PLW1501',
'PLW1508',
'PLW1509',
'PLW1510',
'PLW2101',
'PLW2901',
'PLW3301',
'PT001',
Expand Down Expand Up @@ -510,6 +544,8 @@ def get_config(self, section: str) -> dict[str, Any]:
'RUF018',
'RUF019',
'RUF020',
'RUF024',
'RUF026',
'RUF100',
'S101',
'S102',
Expand Down Expand Up @@ -563,6 +599,7 @@ def get_config(self, section: str) -> dict[str, Any]:
'S607',
'S608',
'S609',
'S610',
'S611',
'S612',
'S701',
Expand Down Expand Up @@ -615,11 +652,6 @@ def get_config(self, section: str) -> dict[str, Any]:
'TID251',
'TID252',
'TID253',
'TRIO100',
'TRIO105',
'TRIO109',
'TRIO110',
'TRIO115',
'TRY002',
'TRY003',
'TRY004',
Expand Down Expand Up @@ -685,6 +717,8 @@ def get_config(self, section: str) -> dict[str, Any]:
'YTT303',
)
PREVIEW_RULES: tuple[str, ...] = (
'ASYNC116',
'B901',
'B909',
'E112',
'E113',
Expand Down Expand Up @@ -717,87 +751,65 @@ def get_config(self, section: str) -> dict[str, Any]:
'E274',
'E275',
'E502',
'FURB105',
'FURB110',
'FURB113',
'FURB116',
'FURB118',
'FURB129',
'FURB131',
'FURB132',
'FURB136',
'FURB142',
'FURB145',
'FURB148',
'FURB152',
'FURB154',
'FURB157',
'FURB161',
'FURB163',
'FURB164',
'FURB166',
'FURB167',
'FURB168',
'FURB169',
'FURB171',
'FURB177',
'FURB180',
'FURB181',
'FURB187',
'FURB192',
'PERF403',
'PLC0206',
'PLC0415',
'PLC1901',
'PLC2401',
'PLC2403',
'PLC2701',
'PLC2801',
'PLE0115',
'PLE0303',
'PLE0304',
'PLE0305',
'PLE0308',
'PLE0309',
'PLE0643',
'PLE0704',
'PLE1132',
'PLE1141',
'PLE1519',
'PLE1520',
'PLE4703',
'PLR0202',
'PLR0203',
'PLR1704',
'PLR1730',
'PLR1733',
'PLR1736',
'PLR2044',
'PLR6104',
'PLR6201',
'PLR6301',
'PLW0108',
'PLW0128',
'PLW0133',
'PLW0177',
'PLW0211',
'PLW0245',
'PLW0604',
'PLW0642',
'PLW1501',
'PLW1514',
'PLW1641',
'PLW2101',
'PLW3201',
'PYI057',
'PYI059',
'PYI062',
'PYI063',
'PYI064',
'PYI066',
'RUF021',
'RUF022',
'RUF023',
'RUF024',
'RUF025',
'RUF026',
'RUF027',
'RUF028',
'RUF029',
'RUF030',
'RUF101',
'S401',
'S402',
Expand All @@ -811,7 +823,6 @@ def get_config(self, section: str) -> dict[str, Any]:
'S412',
'S413',
'S415',
'S610',
'UP042',
'W391',
)
Expand Down
2 changes: 1 addition & 1 deletion src/hatch/env/internal/static_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ def get_default_config() -> dict[str, Any]:
}


RUFF_DEFAULT_VERSION: str = '0.4.5'
RUFF_DEFAULT_VERSION: str = '0.5.0'

0 comments on commit 10a0958

Please sign in to comment.