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

Weird behavior when specifying "on" in identifier_name excluded list #1424

Closed
nvh opened this issue Apr 10, 2017 · 2 comments · Fixed by #1703
Closed

Weird behavior when specifying "on" in identifier_name excluded list #1424

nvh opened this issue Apr 10, 2017 · 2 comments · Fixed by #1703
Labels
enhancement Ideas for improvements of existing features and rules.

Comments

@nvh
Copy link

nvh commented Apr 10, 2017

identifier_name:
  excluded:
    - to
    - id
    - ok
    - on

This stopped working since 0.18.1. Swiftlint now acts as if the excluded list doesn't exist. However, when I remove on from this list, it works as expected (but still giving a warning about the use of on in my codebase of course).

I think this is the result of the switch in YAML parsing, because "on" is a reserved word in yaml used to specify a boolean. I've tried putting it in quotes around "on" but that didn't help.

@norio-nomura
Copy link
Collaborator

norio-nomura commented Apr 10, 2017

because "on" is a reserved word in yaml used to specify a boolean.

You are right.
Could you try using - !str on? That instructs the YAML parser to explicitly parse it as a string.

We may have to customize loading of configuration to avoid this.

@zac
Copy link

zac commented Apr 10, 2017

Same issue for me with "no". Prefixing with - !str works for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Ideas for improvements of existing features and rules.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants