Swiftlint: Weird behavior when specifying "on" in `identifier_name` excluded list

Created on 10 Apr 2017  路  2Comments  路  Source: realm/SwiftLint

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.

enhancement

Most helpful comment

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.

All 2 comments

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.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jcarroll-mediafly picture jcarroll-mediafly  路  3Comments

bourquep picture bourquep  路  3Comments

ivanbruel picture ivanbruel  路  3Comments

larslockefeer picture larslockefeer  路  3Comments

mrtj picture mrtj  路  3Comments