I have followed all steps mention on SwiftLint Github Link and installed SwiftLint in Xcode.
I have added .swiftlint.yml file also and added pods in excluded but when I am building my project it's showing me errors of my pods files also which i have already given in excluded.
Environment
SwiftLint version (run swiftlint version to be sure)? Version : 0.52.2
Installation method used (Homebrew, CocoaPods, building from source, etc)? CocoaPods
Paste your configuration file:
# By default, SwiftLint uses a set of sensible default rules you can adjust:
disabled_rules: # rule identifiers turned on by default to exclude from running
- colon
- comma
- control_statement
opt_in_rules: # some rules are turned off by default, so you need to opt-in
- empty_count # Find all the available rules by running: `swiftlint rules`
- line_length: 500
- trailing_semicolon
- unused_ivars
- empty_delegate
# Alternatively, specify all rules explicitly by uncommenting this option:
# only_rules: # delete `disabled_rules` & `opt_in_rules` if using this
# - empty_parameters
# - vertical_whitespace
analyzer_rules: # Rules run by `swiftlint analyze`
- explicit_self
included: # paths to include during linting. `--path` is ignored if present.
- Source
- Sources/**/*.{h,m}
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Carthage
- Pods
- Pods/
# If true, SwiftLint will not fail if no lintable files are found.
allow_zero_lintable_files: false
# configurable rules can be customized from this configuration file
# binary rules can set their severity level
force_cast: warning # implicitly
force_try:
severity: warning # explicitly
# rules that have both warning and error levels, can set just the warning level
# implicitly
line_length: 500
# they can set both implicitly with an array
type_body_length:
- 300 # warning
- 400 # error
# or they can set both explicitly
file_length:
warning: 500
error: 1200
# naming rules can set warnings/errors for min_length and max_length
# additionally they can set excluded names
type_name:
min_length: 4 # only warning
max_length: # warning and error
warning: 40
error: 50
excluded: iPhone # excluded via string
allowed_symbols: ["_"] # these are allowed in type names
identifier_name:
min_length: # only min_length
error: 4 # only error
excluded: # excluded via string array
- id
- URL
- GlobalAPIKey
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, codeclimate, junit, html, emoji, sonarqube, markdown, github-actions-logging, summary)
Are you using nested configurations? No
If so, paste their relative paths and respective contents.
Which Xcode version are you using (check xcodebuild -version)? Xcode version : 14.3
Do you have a sample that shows the issue? Answer : Yes
Find below attached screenshot which is showing that above .yml file i have added line_length: 500 and in excluded added pods then also it's linting file which is inside pods and showing errors.
excluded:
- Carthage
- Pods
- Pods/
Can you please guide me how to solve this issue and where i am doing wrong ?
New Issue Checklist
Describe the bug
I have followed all steps mention on SwiftLint Github Link and installed SwiftLint in Xcode. I have added
.swiftlint.yml
file also and added pods in excluded but when I am building my project it's showing me errors of my pods files also which i have already given in excluded.Environment
swiftlint version
to be sure)? Version : 0.52.2xcodebuild -version
)? Xcode version : 14.3.yml
file i have addedline_length: 500
and in excluded added pods then also it's linting file which is inside pods and showing errors.Can you please guide me how to solve this issue and where i am doing wrong ?
Thank you