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

ReturnCount JSON Schema is outdated #5588

Closed
TWiStErRob opened this issue Nov 30, 2022 · 4 comments · Fixed by SchemaStore/schemastore#2623
Closed

ReturnCount JSON Schema is outdated #5588

TWiStErRob opened this issue Nov 30, 2022 · 4 comments · Fixed by SchemaStore/schemastore#2623
Labels
help wanted housekeeping Marker for housekeeping tasks and refactorings

Comments

@TWiStErRob
Copy link
Member

TWiStErRob commented Nov 30, 2022

Expected Behavior

https://json.schemastore.org/detekt.json

        "ReturnCount": {
          "type": "object",
          "properties": {
            "active": {
              "type": "boolean"
            },
            "excludedFunctions": {
              "type": "some kind of array"
            },
            ...
          }
        },

Observed Behavior

        "ReturnCount": {
          "type": "object",
          "properties": {
            "active": {
              "type": "boolean"
            },
            "excludedFunctions": {
              "type": "string"
            },
            ...
          }
        },

Steps to Reproduce

Edit detekt.yml in IDEA and add

  ReturnCount:
    max: 3
    excludedFunctions:
      # Ignore MenuProvider.onMenuItemSelected, Activity.onOptionsItemSelected,
      # and Fragment.onOptionsItemSelected, because they have a special structure for bug prevention.
      - 'onMenuItemSelected'
      - 'onOptionsItemSelected'

if you follow the schema you get:

Property 'style>ReturnCount>excludedFunctions' should be a YAML array instead of a comma-separated String.

if you follow the warning you get:

Schema validation: Incompatible types. Required: string. Actual: array.

There's no winning :)

Context

My doc update in #5062 triggered #5063 which was fixed by #5081, but that made the schema on schemastore outdated. Would be solved by #4162

Your Environment

  • Version of detekt used: 1.22.0
@TWiStErRob TWiStErRob added the bug label Nov 30, 2022
@3flex
Copy link
Member

3flex commented Nov 30, 2022

In the meantime, someone can update the schema on schemastore. This isn't technically a detekt bug.

@3flex 3flex added help wanted housekeeping Marker for housekeeping tasks and refactorings and removed bug labels Nov 30, 2022
@TWiStErRob
Copy link
Member Author

Raised SchemaStore/schemastore#2623

@TWiStErRob
Copy link
Member Author

@3flex I guess we agree that it'll be a Detekt bug, once #4162 is done, and we own the schema. 😅

@3flex
Copy link
Member

3flex commented Nov 30, 2022

Looks like it was merged, thanks for opening the PR! Yes, if detekt project starts generating or hosting our own schema, this would definitely be a bug.

@3flex 3flex closed this as not planned Won't fix, can't repro, duplicate, stale Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted housekeeping Marker for housekeeping tasks and refactorings
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants