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

Support tab based indentation in the whitespace linter. #101

Merged
merged 1 commit into from Dec 5, 2019

Conversation

dylansturg
Copy link
Contributor

The linter was crashing whenever it encountered a tab because it only expected spaces to be used for whitespace. The linter now supports a wider range of whitespace characters and allows using tabs for indentation. This includes some revisions to the error messages to add tabs are as a suggestion for adding/removing indentation. There is also a new error message used when tabs (or really any non-space) characters are used for spacing (i.e. the whitespace that isn't indentation).

SR-11211

/// Returns a string that describes the indentation in a human readable format, which is
/// appropriate for use in diagnostic messages.
var diagnosticDescription: String {
switch(self) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove parens around the switch argument here, and two (I think) places below please 🙂 (We should have a rule!)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. The existing rule handled it; I just forgot to run the formatter. 😅

The linter was crashing whenever it encountered a tab because it only expected spaces to be used for whitespace. The linter now supports a wider range of whitespace characters and allows using tabs for indentation. This includes some revisions to the error messages to add tabs are as a suggestion for adding/removing indentation. There is also a new error message used when tabs (or really any non-space) characters are used for spacing (i.e. the whitespace that isn't indentation).

SR-11211
@allevato allevato merged commit 39bc91a into apple:master Dec 5, 2019
@dylansturg dylansturg deleted the handle_more_whitespace branch December 5, 2019 21:38
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.

None yet

2 participants