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

chore: lint _all_ the things #908

Merged
merged 2 commits into from
May 2, 2023
Merged

chore: lint _all_ the things #908

merged 2 commits into from
May 2, 2023

Conversation

ianbotsf
Copy link
Contributor

@ianbotsf ianbotsf commented May 2, 2023

Issue #

(none)

Description of changes

Similar to smithy-kotlin#847, update the lint paths by including all *.kt and *.kts files and then specifically excluding generated code. Fortunately, no regular Kotlin files were impacted (the allowlist was already pretty comprehensive) and the changes are all in Gradle scripts.

No copyright header rule was updated because it doesn't exist in the aws-sdk-kotlin repo. That will have to wait until our linting config is commonized into a separate repo.

Most of this PR is the lint fixes themselves. The only interesting file is build.gradle.kts.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ianbotsf ianbotsf added the no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly. label May 2, 2023
@ianbotsf ianbotsf requested a review from a team as a code owner May 2, 2023 18:19
@@ -178,6 +173,7 @@ tasks.register<JavaExec>("ktlint") {
classpath = configurations.getByName("ktlint")
main = "com.pinterest.ktlint.Main"
args = lintPaths
jvmArgs("--add-opens", "java.base/java.lang=ALL-UNNAMED")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: What does this do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know exactly what it does but it was necessary to get around issues when running gg ktlintFormat. I saw instances of NoClassDefFoundError and InaccessibleObjectException and the related GH issues mentioned this as a solution. KtLint's integrations guide also mentions this may be necessary, albeit in the context of custom Gradle integration (rather than via a plugin like we're doing).

@sonarqubecloud
Copy link

sonarqubecloud bot commented May 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@ianbotsf ianbotsf merged commit 875f796 into main May 2, 2023
@ianbotsf ianbotsf deleted the chore-lint-all-the-things branch May 2, 2023 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Indicates that a changelog entry isn't required for a pull request. Use sparingly.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants