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

Add new rule to SwiftLint for linting type declarations #48

Open
svenmuennich opened this issue Oct 30, 2019 · 0 comments
Open

Add new rule to SwiftLint for linting type declarations #48

svenmuennich opened this issue Oct 30, 2019 · 0 comments
Labels
enhancement Issues that describe new features or improvements to existing features.

Comments

@svenmuennich
Copy link
Member

We should add a rule to SwiftLint via PR that allows linting type declarations, in particular the definition of type inheritance, protocol conformance and generic where clauses as well as the opening { of the type.

This cannot be linted using a regular expression with reasonable complexity and hence needs to be implemented in code. Once we implemented this we should send it as a PR to the main SwiftLint repo and see if they would like to add it. Hence we should think about configuration options, for which I propse the following:

  • An option for configuring the minimum number of protocols and/or inherited types that are required before wrapping them on their own lines.
  • An option for configuring the indentation of each protocol and inherited type, if present, relative to the indentation of the type declaration.
  • An option for configuring the minimum number of where clauses that are required before wrapping them on their own lines.
  • An option for configuring the indentation of the where keyword, if present, relative to the indentation of the type declaration.
  • An option for configuring the indentation of each where clause, if present, relative to the indentation of the where keyword.

If we can implement support for auto-fixing violations with reasonable effort we should do so.

@svenmuennich svenmuennich added the enhancement Issues that describe new features or improvements to existing features. label Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues that describe new features or improvements to existing features.
Projects
None yet
Development

No branches or pull requests

1 participant