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

Refactor user data #1488

Merged
merged 11 commits into from
Jun 8, 2022
Merged

Conversation

paul-dingemans
Copy link
Collaborator

Description

  1. Move "Ktlint.DISABLED_RULES" from userData to EditorConfigOverride.

The userData is defined as Map<String,String>. It is abused to pass down information to ASTNodes. It makes maintenance brittle as there is no compile time checking on key and values. Also, it may conflict with settings in ".editorconfig", or at least it is ambiguous which takes precedence.

  1. Replace property Ktlint.ANDROID_USER_DATA_KEY with EditorConfigOverride.codeStyleProperty. The boolen property is also change to an enumeration (official, android).

  2. Enforce registration of ".editorconfig" properties in interface UsesEditorConfigProperties

  3. Field ExperimentalParams logs warnings when still used. It will be removed in a future release.

  4. Also generate the '.editorconfig' properties which are defined as default editor config properties. Some of those properties (ktlint_code_style and disabled_rules) are not used in the rules but in the lint/format engine only.

  5. Other minor cleanups

Checklist

  • PR description added
  • tests are added
  • CHANGELOG.md is updated

In case of adding a new rule:

  • README.md is updated
  • Rule has been applied on Ktlint itself and violations are fixed

The userData is defined as Map<String,String>. It is abused to pass down information to ASTNodes. It makes maintenance brittle as there is no compile time checking on key and values. Also, it may conflict with settings in ".editorconfig", or at least it is ambiguous which takes precedence.
…ault editor config properties. Some of those properties (ktlint_code_style and disabled_rules) are not used in the rules but in the lint/format engine only.
@paul-dingemans paul-dingemans added this to the 0.46.0 milestone Jun 6, 2022
@paul-dingemans paul-dingemans merged commit cb88ca1 into pinterest:master Jun 8, 2022
@paul-dingemans paul-dingemans deleted the refactor-user-data branch June 8, 2022 16:32
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.

1 participant