py2many icon indicating copy to clipboard operation
py2many copied to clipboard

ktlint from brew (i.e. latest ktlint) breaking macos CI

Open jayvdb opened this issue 3 years ago • 1 comments

Filed upstream issue about the change https://github.com/pinterest/ktlint/pull/1117

Alternatives include

  • improving the test runner to generate PascalCase filenames, but this means the check will still fail when any normal Python code filename is used by real users.
  • A more complicated/confusing version of the first option would be to generate the PascalCase filenames inside py2many for Kotlin - no other transpilers do this, and the test runner would then need to figure out the name which py2many used.
  • use ktlint --stdin to bypass this rule.
  • drop brew on macos, and install v0.45.x instead, like on linux

jayvdb avatar Jun 26 '22 09:06 jayvdb

Once upstream has done a release, we can remove the .editorconfig and use

diff --git a/py2many/cli.py b/py2many/cli.py
index 5cc907b6..dbc07001 100755
--- a/py2many/cli.py
+++ b/py2many/cli.py
@@ -329,7 +329,7 @@ def kotlin_settings(args, env=os.environ):
         KotlinTranspiler(),
         ".kt",
         "Kotlin",
-        ["ktlint", "-F"],
+        ["ktlint", "--disabled_rules=filename", "-F"],
         rewriters=[KotlinBitOpRewriter()],
         transformers=[infer_kotlin_types],
         post_rewriters=[KotlinPrintRewriter()],

jayvdb avatar Jul 02 '22 10:07 jayvdb