Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add denyRegex support for import-alias-naming rule #927

Merged
merged 1 commit into from
Oct 29, 2023

Conversation

denisvmedia
Copy link
Collaborator

This PR provides an extension to the existing import-alias-naming rule. While it preserves the backwards compatible configuration, with which it is possible to define an allow regex pattern for import aliases, this PR brings a way to configure any or both pattern types: allowRegex and/or denyRegex. This brings two types of configuration:

  1. The original one, allow pattern:
    # the original one, allow pattern
    [rule.import-alias-naming]
      arguments = ["^[a-z][a-z0-9]{0,}$"]
  2. The new one, both allow and deny patterns:
    [rule.import-alias-naming]
      arguments = [ { allowRegex = "^[a-z][a-z0-9]{0,}$", denyRegex = '^v\d+$' } ]

Closes #924.

@denisvmedia denisvmedia force-pushed the extend-import-alias-naming branch 2 times, most recently from 7281c35 to 97f7ac4 Compare October 29, 2023 09:29
@denisvmedia denisvmedia force-pushed the extend-import-alias-naming branch from 97f7ac4 to 2f51cb2 Compare October 29, 2023 09:30
@chavacava chavacava merged commit fd9a130 into mgechev:master Oct 29, 2023
4 checks passed
@chavacava
Copy link
Collaborator

Thank you @denisvmedia

@denisvmedia denisvmedia deleted the extend-import-alias-naming branch October 29, 2023 12:26
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Supporting multiple expressions for import-alias-naming
2 participants