realm / SwiftLint

A tool to enforce Swift style and conventions.
https://realm.github.io/SwiftLint
MIT License
18.68k stars 2.22k forks source link

Excluded Pods not working and linting pods files even after adding it in excluded. #5067

Open bhavsang-prolius opened 1 year ago

bhavsang-prolius commented 1 year ago

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.

Screenshot 2023-06-19 at 3 13 59 PM

Environment

# 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)
excluded: 
  - Carthage
  - Pods
  - Pods/
Screenshot 2023-06-19 at 3 23 27 PM

Can you please guide me how to solve this issue and where i am doing wrong ?

Thank you

trozware commented 1 year ago

You might be able to solve this by adding the working directory to the exclude list, like this:

excluded:
  - ${PWD}/Carthage
  - ${PWD}/Pods
bhavsang-prolius commented 4 months ago

Still getting same issue.