Skip to content

Commit

Permalink
Upgrade Ruff to 0.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPapadopoulos committed Jan 15, 2025
1 parent 64031c1 commit f7dcf27
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 29 deletions.
7 changes: 7 additions & 0 deletions docs/.hooks/render_ruff_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ def run(self, lines): # noqa: PLR6301

UNSELECTED_RULES: tuple[str, ...] = (
'AIR001',
'AIR301',
'AIR302',
'AIR303',
'ANN001',
'ANN002',
'ANN003',
Expand Down Expand Up @@ -229,6 +232,7 @@ def run(self, lines): # noqa: PLR6301
'E305',
'E306',
'E501',
'E999',
'ERA001',
'FBT003',
'FIX001',
Expand Down Expand Up @@ -307,6 +311,8 @@ def run(self, lines): # noqa: PLR6301
'PTH205',
'PTH206',
'PTH207',
'PTH208',
'PTH210',
'Q000',
'Q001',
'Q002',
Expand All @@ -324,5 +330,6 @@ def run(self, lines): # noqa: PLR6301
'TD002',
'TD003',
'TRY200',
'UP027',
'W191',
)
1 change: 1 addition & 0 deletions docs/history/hatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

***Added:***

- Upgrade Ruff to 0.9.1
- The `version` and `project metadata` commands now support projects that do not use Hatchling as the build backend
- The `version` command accepts a `--force` option, allowing for downgrades when an explicit version number is given.
- Build environments can now be configured, the default build environment is `hatch-build`
Expand Down
86 changes: 58 additions & 28 deletions src/hatch/cli/fmt/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ def get_config(self, section: str) -> dict[str, Any]:
'A001',
'A002',
'A003',
'A004',
'A005',
'A006',
'ARG001',
'ARG002',
'ARG003',
Expand Down Expand Up @@ -210,6 +213,7 @@ def get_config(self, section: str) -> dict[str, Any]:
'B033',
'B034',
'B035',
'B039',
'B904',
'B905',
'BLE001',
Expand Down Expand Up @@ -258,7 +262,6 @@ def get_config(self, section: str) -> dict[str, Any]:
'E742',
'E743',
'E902',
'E999',
'EM101',
'EM102',
'EM103',
Expand Down Expand Up @@ -312,6 +315,8 @@ def get_config(self, section: str) -> dict[str, Any]:
'F901',
'FA100',
'FA102',
'FAST001',
'FAST002',
'FBT001',
'FBT002',
'FLY002',
Expand All @@ -326,6 +331,7 @@ def get_config(self, section: str) -> dict[str, Any]:
'FURB177',
'FURB181',
'FURB187',
'FURB188',
'G001',
'G002',
'G003',
Expand Down Expand Up @@ -382,6 +388,7 @@ def get_config(self, section: str) -> dict[str, Any]:
'PLC0131',
'PLC0132',
'PLC0205',
'PLC0206',
'PLC0208',
'PLC0414',
'PLC2401',
Expand Down Expand Up @@ -429,6 +436,7 @@ def get_config(self, section: str) -> dict[str, Any]:
'PLR1704',
'PLR1711',
'PLR1714',
'PLR1716',
'PLR1722',
'PLR1730',
'PLR1736',
Expand Down Expand Up @@ -531,6 +539,9 @@ def get_config(self, section: str) -> dict[str, Any]:
'PYI057',
'PYI058',
'PYI062',
'PYI063',
'PYI064',
'PYI066',
'RET503',
'RET504',
'RET505',
Expand All @@ -555,8 +566,15 @@ def get_config(self, section: str) -> dict[str, Any]:
'RUF018',
'RUF019',
'RUF020',
'RUF021',
'RUF022',
'RUF023',
'RUF024',
'RUF026',
'RUF030',
'RUF032',
'RUF033',
'RUF034',
'RUF100',
'RUF101',
'S101',
Expand Down Expand Up @@ -651,12 +669,12 @@ def get_config(self, section: str) -> dict[str, Any]:
'T100',
'T201',
'T203',
'TCH001',
'TCH002',
'TCH003',
'TCH004',
'TCH005',
'TCH010',
'TC001',
'TC002',
'TC003',
'TC004',
'TC005',
'TC010',
'TD004',
'TD005',
'TD006',
Expand All @@ -668,9 +686,9 @@ def get_config(self, section: str) -> dict[str, Any]:
'TRY003',
'TRY004',
'TRY201',
'TRY203',
'TRY300',
'TRY301',
'TRY302',
'TRY400',
'TRY401',
'UP001',
Expand All @@ -697,7 +715,6 @@ def get_config(self, section: str) -> dict[str, Any]:
'UP024',
'UP025',
'UP026',
'UP027',
'UP028',
'UP029',
'UP030',
Expand All @@ -712,6 +729,7 @@ def get_config(self, section: str) -> dict[str, Any]:
'UP039',
'UP040',
'UP041',
'UP043',
'W291',
'W292',
'W293',
Expand All @@ -729,20 +747,19 @@ def get_config(self, section: str) -> dict[str, Any]:
'YTT303',
)
PREVIEW_RULES: tuple[str, ...] = (
'A004',
'A005',
'A006',
'ASYNC116',
'B039',
'B901',
'B903',
'B909',
'B911',
'C420',
'DOC201',
'DOC202',
'DOC402',
'DOC403',
'DOC501',
'DOC502',
'DTZ901',
'E112',
'E113',
'E115',
Expand Down Expand Up @@ -775,8 +792,6 @@ def get_config(self, section: str) -> dict[str, Any]:
'E274',
'E275',
'E502',
'FAST001',
'FAST002',
'FAST003',
'FURB110',
'FURB113',
Expand All @@ -789,15 +804,17 @@ def get_config(self, section: str) -> dict[str, Any]:
'FURB148',
'FURB152',
'FURB154',
'FURB156',
'FURB157',
'FURB164',
'FURB166',
'FURB171',
'FURB180',
'FURB188',
'FURB189',
'FURB192',
'PLC0206',
'LOG015',
'PLC0415',
'PLC1802',
'PLC1901',
'PLC2701',
'PLC2801',
Expand All @@ -812,24 +829,32 @@ def get_config(self, section: str) -> dict[str, Any]:
'PLR6301',
'PLW0108',
'PLW0177',
'PLW1507',
'PLW1514',
'PLW1641',
'PLW3201',
'PYI059',
'PYI063',
'PYI064',
'PYI066',
'RUF021',
'RUF022',
'RUF023',
'PYI061',
'RUF027',
'RUF028',
'RUF029',
'RUF030',
'RUF031',
'RUF032',
'RUF033',
'RUF034',
'RUF035',
'RUF036',
'RUF037',
'RUF038',
'RUF039',
'RUF040',
'RUF041',
'RUF043',
'RUF046',
'RUF048',
'RUF049',
'RUF051',
'RUF052',
'RUF055',
'RUF056',
'RUF057',
'S401',
'S402',
'S403',
Expand All @@ -842,8 +867,13 @@ def get_config(self, section: str) -> dict[str, Any]:
'S412',
'S413',
'S415',
'SIM905',
'TC006',
'TC007',
'TC008',
'UP042',
'UP043',
'UP044',
'UP045',
'W391',
)
PER_FILE_IGNORED_RULES: dict[str, list[str]] = {
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.6.8'
RUFF_DEFAULT_VERSION: str = '0.9.1'

0 comments on commit f7dcf27

Please sign in to comment.