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

Update ktlint descriptor to support list_of_files and better error counting #3575

Merged
merged 1 commit into from
May 26, 2024

Conversation

Yann-J
Copy link
Contributor

@Yann-J Yann-J commented May 23, 2024

Fixes #1441

Proposed Changes

  1. Enable list_of_files mode in KOTLIN_KTLINT (which it supports OOB)
  2. Configured regex to better count violations

Readiness Checklist

Author/Contributor

  • Add entry to the CHANGELOG listing the change and linking to the corresponding issue (if appropriate)
  • If documentation is needed for this change, has that been included in this pull request

Unfortunately, I haven't been able for the life of me to run a proper build and test, as make is causing all sorts of headaches that I couldn't figure out... The make version in MacOS is very old (3.81 from 2006) and the newer version I installed (4.4.1, called gmake) somehow hangs even on trivial tasks like gmake help.

So I've only been able to test by compiling a local image, since the dockerfile appears unchanged (docker buildx build -f linters/kotlin_ktlint/Dockerfile .) and run it, but I couldn't rebuild everything and run tests...

Reviewing Maintainer

  • Label as breaking if this is a large fundamental change
  • Label as either automation, bug, documentation, enhancement, infrastructure, or performance

@echoix
Copy link
Collaborator

echoix commented May 23, 2024

How do we know that the sum/count of errors work? Is there a part of the tests that should cover it? Otherwise it's good to me!

@nvuillam
Copy link
Member

@echoix when there is a regex defined to identify the number of errors, the test passes only if the number found is >= 2 :)

Copy link
Member

@nvuillam nvuillam left a comment

Choose a reason for hiding this comment

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

Amazing @Yann-J , thanks a lot :)

@nvuillam nvuillam merged commit 69135cd into oxsecurity:main May 26, 2024
6 checks passed
@echoix
Copy link
Collaborator

echoix commented May 26, 2024

@echoix when there is a regex defined to identify the number of errors, the test passes only if the number found is >= 2 :)

Good to know!

@Yann-J Yann-J deleted the ktlint-list-of-files branch June 4, 2024 14:10
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.

Extremely slow kotlin linting
3 participants