Skip to content

Commit cfee306

Browse files
committed
MAINT: enforce string quoting style with ruff
Alphabetically sort ruff.lint sections in pyproject.toml, and fix a couple of f-string instances using double quotes.
1 parent 6414f05 commit cfee306

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ repos:
1818
- id: check-yaml
1919
- id: check-toml
2020
- id: debug-statements
21-
- id: double-quote-string-fixer
2221
- id: end-of-file-fixer
2322
- id: trailing-whitespace
2423
- repo: https://github.com/astral-sh/ruff-pre-commit

mesonpy/_tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def _get_ios_platform_tag() -> str:
173173
# by `packaging` as part of tag determiniation.
174174
multiarch = sys.implementation._multiarch.replace('-', '_')
175175

176-
return f"ios_{version[0]}_{version[1]}_{multiarch}"
176+
return f'ios_{version[0]}_{version[1]}_{multiarch}'
177177

178178

179179
def get_platform_tag() -> str:

pyproject.toml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,29 @@ lint.select = [
8585
'E', # pycodestyle
8686
'F', # pyflakes
8787
'I', # isort
88+
'Q', # flake8-quotes
8889
'W', # pycodestyle
8990
'RUF100', # ruff
9091
]
9192
exclude = [
9293
'docs/conf.py',
9394
]
9495

96+
[tool.ruff.format]
97+
quote-style = 'single'
98+
99+
[tool.ruff.lint.flake8-quotes]
100+
avoid-escape = false
101+
inline-quotes = 'single'
102+
multiline-quotes = 'single'
103+
95104
[tool.ruff.lint.isort]
96105
lines-between-types = 1
97106
lines-after-imports = 2
98107
known-first-party = [
99108
'mesonpy',
100109
]
101110

102-
[tool.ruff.format]
103-
quote-style = 'single'
104-
105111

106112
[tool.coverage.run]
107113
disable_warnings = [

tests/test_project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def test_ios_project(package_simple, monkeypatch, multiarch, tmp_path):
392392
# Mock being on iOS
393393
monkeypatch.setattr(sys, 'platform', 'ios')
394394
monkeypatch.setattr(platform, 'machine', Mock(return_value=arch))
395-
monkeypatch.setattr(sysconfig, 'get_platform', Mock(return_value=f"ios-13.0-{multiarch}"))
395+
monkeypatch.setattr(sysconfig, 'get_platform', Mock(return_value=f'ios-13.0-{multiarch}'))
396396
ios_ver = platform.IOSVersionInfo('iOS', '13.0', 'iPhone', multiarch.endswith('simulator'))
397397
monkeypatch.setattr(platform, 'ios_ver', Mock(return_value=ios_ver))
398398

0 commit comments

Comments
 (0)