Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Can't disable custom rule in nested config file #2441
New Issue Checklist
Describe the bug
When attempting to disable a custom rule defined in a parent configuration from a nested configuration, SwiftLint can't find that rule and prints the message
Complete output when running SwiftLint, including the stack trace and command used
$ tree -a . ├── .swiftlint.yml ├── dir1 │ ├── .swiftlint.yml │ └── file2.swift └── file1.swift 1 directory, 4 files $ cat .swiftlint.yml custom_rules: no_abc: name: "Don't use abc" regex: 'abc' $ cat file1.swift // abc $ cat dir1/.swiftlint.yml disabled_rules: - no_abc $ cat dir1/file2.swift // abc $ swiftlint Loading configuration from '.swiftlint.yml' Linting Swift files at paths ... configuration error: 'no_abc' is not a valid rule identifier Valid rule identifiers: anyobject_protocol ... yoda_condition Linting 'file1.swift' (1/2) Linting 'file2.swift' (2/2) /path/to/dir/file1.swift:1:4: warning: Don't use abc Violation: Regex matched. (no_abc) /path/to/dir/dir1/file2.swift:1:4: warning: Don't use abc Violation: Regex matched. (no_abc) Done linting! Found 2 violations, 0 serious in 2 files.