Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ktlint 0.50.0 and drop support for 0.47.0 #1748

Merged
merged 6 commits into from
Jul 14, 2023

Conversation

magneticflux-
Copy link
Contributor

Closes #1741

Please DO NOT FORCE PUSH. Don't worry about messy history, it's easier to do code review if we can tell what happened after the review, and force pushing breaks that.

Please make sure that your PR allows edits from maintainers. Sometimes its faster for us to just fix something than it is to describe how to fix it.

Allow edits from maintainers

After creating the PR, please add a commit that adds a bullet-point under the [Unreleased] section of CHANGES.md, plugin-gradle/CHANGES.md, and plugin-maven/CHANGES.md which includes:

  • a summary of the change
  • either
    • a link to the issue you are resolving (for small changes)
    • a link to the PR you just created (for big changes likely to have discussion)

If your change only affects a build plugin, and not the lib, then you only need to update the plugin-foo/CHANGES.md for that plugin.

If your change affects lib in an end-user-visible way (fixing a bug, updating a version) then you need to update CHANGES.md for both the lib and all build plugins. Users of a build plugin shouldn't have to refer to lib to see changes that affect them.

This makes it easier for the maintainers to quickly release your changes :)


Additional notes for discussion:

@magneticflux-
Copy link
Contributor Author

magneticflux- commented Jul 8, 2023

An additional note:
Since this drops support for KtLint 0.47.0, all supported releases of KtLint use the ktlint_experimental EditorConfig property instead of a special parameter (0.48.0 changelog). Should we drop the boolean useExperimental parameter from KtLintCompatAdapter and rely solely on ktlint_experimental? This would clean up some warning code in each compat adapter: https://github.com/diffplug/spotless/blob/3bafa6a28e4c3f1f982f06f652b793758f443169/lib/src/compatKtLint0Dot50Dot0/java/com/diffplug/spotless/glue/ktlint/compat/KtLintCompat0Dot50Dot0Adapter.java#L96C1-L104

@nedtwigg
Copy link
Member

Sorry for the slow review, this is great!

Should we drop the boolean useExperimental parameter from KtLintCompatAdapter and rely solely on ktlint_experimental? This would clean up some warning code in each compat adapter:

That would be fantastic, thanks! I'll merge and release as soon as that is complete.

@magneticflux-
Copy link
Contributor Author

Expected impact of the removal of useExperimental is minimal.

@magneticflux-
Copy link
Contributor Author

The NPM eslintStyleguideXo() test failure seems unrelated.

Error: ROR] Step 'eslint-format' found problem in 'src/main/typescript/test.ts':
  > Unexpected response status code at /eslint/format [HTTP 500] -- (Error while formatting: Error: --config#overrides[0] » eslint-config-xo-typescript:
  > 	Configuration for rule "@typescript-eslint/no-restricted-imports" is invalid:
  > 	Value ["error","domain","freelist","smalloc","punycode","sys","querystring","colors"] should be string.
  > 	Value ["error","domain","freelist","smalloc","punycode","sys","querystring","colors"] should be object.
  > 	Value ["error","domain","freelist","smalloc","punycode","sys","querystring","colors"] should match some schema in anyOf.
  > 	Value ["error","domain","freelist","smalloc","punycode","sys","querystring","colors"] should be object.
  > 	Value [["error","domain","freelist","smalloc","punycode","sys","querystring","colors"]] should match some schema in anyOf.
  > )
  > com.diffplug.spotless.npm.SimpleRestClient$SimpleRestResponseException: Unexpected response status code at /eslint/format [HTTP 500] -- (Error while formatting: Error: --config#overrides[0] » eslint-config-xo-typescript:
  > 	Configuration for rule "@typescript-eslint/no-restricted-imports" is invalid:
  > 	Value ["error","domain","freelist","smalloc","punycode","sys","querystring","colors"] should be string.
  > 	Value ["error","domain","freelist","smalloc","punycode","sys","querystring","colors"] should be object.
  > 	Value ["error","domain","freelist","smalloc","punycode","sys","querystring","colors"] should match some schema in anyOf.
  > 	Value ["error","domain","freelist","smalloc","punycode","sys","querystring","colors"] should be object.
  > 	Value [["error","domain","freelist","smalloc","punycode","sys","querystring","colors"]] should match some schema in anyOf.
  > )

@nedtwigg nedtwigg merged commit dcfd57c into diffplug:main Jul 14, 2023
10 of 11 checks passed
@nedtwigg
Copy link
Member

Released in plugin-gradle 6.20.0 and plugin-maven 2.38.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for ktlint 0.50.0
2 participants