Skip to content

Commit

Permalink
[flynt] remove buggy --transform-concats option
Browse files Browse the repository at this point in the history
Summary:
See ikamensh/flynt#173

The linter will still be able to convert "%"-formatted strings  and `"{}".format(` occurences to f-strings.
It will no longer simplify string concatenations.

Test Plan:
Touch test_runner.py and make sure `arc lint` does not clear the file.

Add actual lines that flynt will update, and check that the changes from `arc lint` is as expected. E.g:
```
diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py
index 38ac427eeb..079079e3bb 100755
--- a/test/functional/test_runner.py
+++ b/test/functional/test_runner.py
@@ -163,6 +163,9 @@ class TestCase:
         self.test_num = test_num
         self.failfast_event = failfast_event
         self.flags = flags
+        a = "%s " % "toto"
+        b = "{}".format(a)
+        print(a + b)

     def run(self):
         if self.failfast_event.is_set():
```

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D13573
  • Loading branch information
PiRK committed Apr 5, 2023
1 parent 12d7bb7 commit 26b68cf
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions .arclint
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,7 @@
"type": "lint-python-flynt",
"version": ">=0.78",
"include": "(\\.py$)",
"exclude": "(^contrib/)",
"flags": [
"--transform-concats"
]
"exclude": "(^contrib/)"
}
}
}

0 comments on commit 26b68cf

Please sign in to comment.