Skip to content

Commit 774a7b8

Browse files
seismanyvonnefroehlichmichaelgrund
authored
Enable ruff's flake8-implicit-str-concat (ISC) rules (#2837)
* Enable ruff's flake8-implicit-str-concat (ISC) rules * Update pygmt/clib/session.py * Add ISC to pyproject.toml and ignore ISC001 Co-authored-by: Yvonne Fröhlich <[email protected]> Co-authored-by: Michael Grund <[email protected]>
1 parent 4378b88 commit 774a7b8

File tree

3 files changed

+28
-27
lines changed

3 files changed

+28
-27
lines changed

pygmt/clib/session.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,8 +768,7 @@ def _parse_constant(self, constant, valid, valid_modifiers=None):
768768
)
769769
if nmodifiers > 0 and valid_modifiers is None:
770770
raise GMTInvalidInput(
771-
"Constant modifiers not allowed since valid values were not "
772-
+ f"given: '{constant}'"
771+
"Constant modifiers are not allowed since valid values were not given: '{constant}'"
773772
)
774773
if name not in valid:
775774
raise GMTInvalidInput(

pygmt/helpers/utils.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -244,17 +244,17 @@ def non_ascii_to_octal(argstr):
244244
c: "@~\\" + format(i, "o") + "@~"
245245
for c, i in zip(
246246
" !∀#∃%&∋()∗+,−./" # \04x-05x
247-
+ "0123456789:;<=>?" # \06x-07x
248-
+ "≅ΑΒΧΔΕΦΓΗΙϑΚΛΜΝΟ" # \10x-11x
249-
+ "ΠΘΡΣΤΥςΩΞΨΖ[∴]⊥_" # \12x-13x
250-
+ "αβχδεφγηιϕκλμνο" # \14x-15x
251-
+ "πθρστυϖωξψζ{|}∼" # \16x-17x. \177 is undefined
252-
+ "€ϒ′≤⁄∞ƒ♣♦♥♠↔←↑→↓" # \24x-\25x
253-
+ "°±″≥×∝∂•÷≠≡≈…↵" # \26x-27x
254-
+ "ℵℑℜ℘⊗⊕∅∩∪⊃⊇⊄⊂⊆∈∉" # \30x-31x
255-
+ "∠∇®©™∏√⋅¬∧∨⇔⇐⇑⇒⇓" # \32x-33x
256-
+ "◊〈®©™∑" # \34x-35x
257-
+ "〉∫⌠⌡", # \36x-37x. \360 and \377 are undefined
247+
"0123456789:;<=>?" # \06x-07x
248+
"≅ΑΒΧΔΕΦΓΗΙϑΚΛΜΝΟ" # \10x-11x
249+
"ΠΘΡΣΤΥςΩΞΨΖ[∴]⊥_" # \12x-13x
250+
"αβχδεφγηιϕκλμνο" # \14x-15x
251+
"πθρστυϖωξψζ{|}∼" # \16x-17x. \177 is undefined
252+
"€ϒ′≤⁄∞ƒ♣♦♥♠↔←↑→↓" # \24x-\25x
253+
"°±″≥×∝∂•÷≠≡≈…↵" # \26x-27x
254+
"ℵℑℜ℘⊗⊕∅∩∪⊃⊇⊄⊂⊆∈∉" # \30x-31x
255+
"∠∇®©™∏√⋅¬∧∨⇔⇐⇑⇒⇓" # \32x-33x
256+
"◊〈®©™∑" # \34x-35x
257+
"〉∫⌠⌡", # \36x-37x. \360 and \377 are undefined
258258
[*range(32, 127), *range(160, 240), *range(241, 255)],
259259
)
260260
}
@@ -269,17 +269,17 @@ def non_ascii_to_octal(argstr):
269269
c: "@%34%\\" + format(i, "o") + "@%%"
270270
for c, i in zip(
271271
" ✁✂✃✄☎✆✇✈✉☛☞✌✍✎✏" # \04x-\05x
272-
+ "✐✑✒✓✔✕✖✗✘✙✚✛✜✝✞✟" # \06x-\07x
273-
+ "✠✡✢✣✤✥✦✧★✩✪✫✬✭✮✯" # \10x-\11x
274-
+ "✰✱✲✳✴✵✶✷✸✹✺✻✼✽✾✿" # \12x-\13x
275-
+ "❀❁❂❃❄❅❆❇❈❉❊❋●❍■❏" # \14x-\15x
276-
+ "❐❑❒▲▼◆❖◗❘❙❚❛❜❝❞" # \16x-\17x. \177 is undefined
277-
+ "❡❢❣❤❥❦❧♣♦♥♠①②③④" # \24x-\25x. \240 is undefined
278-
+ "⑤⑥⑦⑧⑨⑩❶❷❸❹❺❻❼❽❾❿" # \26x-\27x
279-
+ "➀➁➂➃➄➅➆➇➈➉➊➋➌➍➎➏" # \30x-\31x
280-
+ "➐➑➒➓➔→↔↕➘➙➚➛➜➝➞➟" # \32x-\33x
281-
+ "➠➡➢➣➤➥➦➧➨➩➪➫➬➭➮➯" # \34x-\35x
282-
+ "➱➲➳➴➵➶➷➸➹➺➻➼➽➾", # \36x-\37x. \360 and \377 are undefined
272+
"✐✑✒✓✔✕✖✗✘✙✚✛✜✝✞✟" # \06x-\07x
273+
"✠✡✢✣✤✥✦✧★✩✪✫✬✭✮✯" # \10x-\11x
274+
"✰✱✲✳✴✵✶✷✸✹✺✻✼✽✾✿" # \12x-\13x
275+
"❀❁❂❃❄❅❆❇❈❉❊❋●❍■❏" # \14x-\15x
276+
"❐❑❒▲▼◆❖◗❘❙❚❛❜❝❞" # \16x-\17x. \177 is undefined
277+
"❡❢❣❤❥❦❧♣♦♥♠①②③④" # \24x-\25x. \240 is undefined
278+
"⑤⑥⑦⑧⑨⑩❶❷❸❹❺❻❼❽❾❿" # \26x-\27x
279+
"➀➁➂➃➄➅➆➇➈➉➊➋➌➍➎➏" # \30x-\31x
280+
"➐➑➒➓➔→↔↕➘➙➚➛➜➝➞➟" # \32x-\33x
281+
"➠➡➢➣➤➥➦➧➨➩➪➫➬➭➮➯" # \34x-\35x
282+
"➱➲➳➴➵➶➷➸➹➺➻➼➽➾", # \36x-\37x. \360 and \377 are undefined
283283
[*range(32, 127), *range(161, 240), *range(241, 255)],
284284
)
285285
}
@@ -295,9 +295,9 @@ def non_ascii_to_octal(argstr):
295295
c: "\\" + format(i, "o")
296296
for c, i in zip(
297297
"•…™—–fiž" # \03x. \030 is undefined
298-
+ "š" # \177
299-
+ "Œ†‡Ł⁄‹Š›œŸŽł‰„“”" # \20x-\21x
300-
+ "ı`´ˆ˜¯˘˙¨‚˚¸'˝˛ˇ", # \22x-\23x
298+
"š" # \177
299+
"Œ†‡Ł⁄‹Š›œŸŽł‰„“”" # \20x-\21x
300+
"ı`´ˆ˜¯˘˙¨‚˚¸'˝˛ˇ", # \22x-\23x
301301
[*range(25, 32), *range(127, 160)],
302302
)
303303
}

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ select = [
104104
"F", # pyflakes
105105
"FLY", # flynt
106106
"I", # isort
107+
"ISC", # flake8-implicit-str-concat
107108
"NPY", # numpy
108109
"PD", # pandas-vet
109110
"PL", # pylint
@@ -113,6 +114,7 @@ select = [
113114
]
114115
ignore = [
115116
"E501", # Avoid enforcing line-length violations
117+
"ISC001", # Single-line-implicit-string-concatenation, conflict with formatter
116118
"PD901", # Allow using the generic variable name `df` for DataFrames
117119
"PLR2004", # Allow any magic values
118120
"SIM117", # Allow nested `with` statements

0 commit comments

Comments
 (0)