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

detekt 1.20.0 - Property 'formatting' is misspelled or does not exist. #44

Open
psud opened this issue Apr 22, 2022 · 2 comments
Open

Comments

@psud
Copy link

psud commented Apr 22, 2022

Hello all,

We use the detekt GitHub action as follows (shortend to relevant parts only):

jobs:
  detekt:
    name: run detekt analysis
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v2
      - name: Detekt
        uses: natiginfo/[email protected]
        with:
          args: '-c ${{ env.detekt_config }} -b ${{ env.detekt_baseline }} -r html:${{ env.detekt_report }} --build-upon-default-config'
      

When GitHub executes the action it fails with the following error

Property 'formatting' is misspelled or does not exist.
Run failed with 1 invalid config property.
	- Property 'formatting' is misspelled or does not exist.

Passing the parameter -formatting or --formatting does not change the outcome.

formatting was added in 1.20.0 (https://detekt.dev/changelog.html#1200---2022-04-14) but is not documented in cli parameters (https://detekt.dev/cli.html#use-the-cli) so I am not sure which component actually has the issue. This GitHub action project or detekt itself.

Thanks in advance for your input!

@petrazavadska
Copy link

In the cli documentation https://detekt.dev/docs/gettingstarted/cli/ there is a following mention of formatting below --auto-correct option:
The additional 'formatting' rule set, added with '--plugins', does support it and needs this flag.
In --plugins you have following description:
Extra paths to plugin jars separated by ',' or ';'.

So I did what it asked and downloaded the needed jar file from here: https://github.com/detekt/detekt/releases/download/v1.20.0/detekt-formatting-1.20.0.jar and copied it to my project.

My step is defined like this:

- name: Detekt checks
  uses: natiginfo/[email protected]
  with:
    args: --build-upon-default-config --config ./config/detekt.yml --plugins ./config/detekt-formatting-1.20.0.jar

Not sure if this is really needed or there is another way to handle this issue but for the time being this works :D

@stuebingerb
Copy link

Still broken in 1.21.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

No branches or pull requests

3 participants