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

Comments

Projects
None yet
4 participants
@nvh

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

This comment has been minimized.

Show comment
Hide comment
@norio-nomura

norio-nomura Apr 10, 2017

Collaborator

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.

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

This comment has been minimized.

Show comment
Hide comment
@zac

zac Apr 10, 2017

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

zac commented Apr 10, 2017

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

marcelofabri added a commit to marcelofabri/SwiftLint that referenced this issue Jul 22, 2017

Customize YAML loading for configurations
This enables:

1. Using environment variables inside a configuration (fixes realm#1512)
2. Treating reserved keywords as strings (`yes`, `no`, `on` and `off`) instead of booleans (fixes realm#1424)

marcelofabri added a commit to marcelofabri/SwiftLint that referenced this issue Jul 22, 2017

Customize YAML loading for configurations
This enables:

1. Using environment variables inside a configuration (fixes realm#1512)
2. Treating reserved keywords as strings (`yes`, `no`, `on` and `off`) instead of booleans (fixes realm#1424)

marcelofabri added a commit to marcelofabri/SwiftLint that referenced this issue Jul 22, 2017

Customize YAML loading for configurations
This enables:

1. Using environment variables inside a configuration (fixes realm#1512)
2. Treating reserved keywords as strings (`yes`, `no`, `on` and `off`) instead of booleans (fixes realm#1424)

marcelofabri added a commit to marcelofabri/SwiftLint that referenced this issue Jul 23, 2017

Customize YAML loading for configurations
This enables:

1. Using environment variables inside a configuration (fixes realm#1512)
2. Treating reserved keywords as strings (`yes`, `no`, `on` and `off`) instead of booleans (fixes realm#1424)

marcelofabri added a commit to marcelofabri/SwiftLint that referenced this issue Jul 23, 2017

Customize YAML loading for configurations
This enables:

1. Using environment variables inside a configuration (fixes realm#1512)
2. Treating reserved keywords as strings (`yes`, `no`, `on` and `off`) instead of booleans (fixes realm#1424)

marcelofabri added a commit to marcelofabri/SwiftLint that referenced this issue Jul 25, 2017

Customize YAML loading for configurations
This enables:

1. Using environment variables inside a configuration (fixes realm#1512)
2. Treating reserved keywords as strings (`yes`, `no`, `on` and `off`) instead of booleans (fixes realm#1424)

marcelofabri added a commit to marcelofabri/SwiftLint that referenced this issue Jul 26, 2017

Customize YAML loading for configurations
This enables:

1. Using environment variables inside a configuration (fixes realm#1512)
2. Treating reserved keywords as strings (`yes`, `no`, `on` and `off`) instead of booleans (fixes realm#1424)

marcelofabri added a commit to marcelofabri/SwiftLint that referenced this issue Jul 29, 2017

Customize YAML loading for configurations
This enables:

1. Using environment variables inside a configuration (fixes realm#1512)
2. Treating reserved keywords as strings (`yes`, `no`, `on` and `off`) instead of booleans (fixes realm#1424)

marcelofabri added a commit to marcelofabri/SwiftLint that referenced this issue Aug 1, 2017

Customize YAML loading for configurations
This enables:

1. Using environment variables inside a configuration (fixes realm#1512)
2. Treating reserved keywords as strings (`yes`, `no`, `on` and `off`) instead of booleans (fixes realm#1424)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment