Skip to content

Commit

Permalink
Adding swiftlint
Browse files Browse the repository at this point in the history
  • Loading branch information
Santiago committed Mar 25, 2021
1 parent 04fc843 commit b32bc54
Show file tree
Hide file tree
Showing 25 changed files with 1,231 additions and 872 deletions.
102 changes: 102 additions & 0 deletions Example/.swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# https://realm.github.io/SwiftLint/rule-directory.html
# 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
- line_length
- trailing_whitespace
- xctfail_message
- function_parameter_count
- weak_delegate
- switch_case_alignment
- type_body_length
- file_length
- nesting
# remove follow rules after analyze
- todo
- unused_setter_value
- cyclomatic_complexity
- notification_center_detachment
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`
- sorted_imports

# Alternatively, specify all rules explicitly by uncommenting this option:
# only_rules: # delete `disabled_rules` & `opt_in_rules` if using this
# - empty_parameters
# - vertical_whitespace

included: # paths to include during linting. `--path` is ignored if present.
- SnazzyList
- ../SnazzyList
excluded: # paths to ignore during linting. Takes precedence over `included`.
- Pods
analyzer_rules: # Rules run by `swiftlint analyze` (experimental)
- explicit_self

# 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: 110
# they can set both implicitly with an array
# or they can set both explicitly
large_tuple:
warning: 5
error: 10
# 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: 200
error: 300
excluded:
- iPhone # excluded via string
- API
allowed_symbols: ["_"] # these are allowed in type names
function_body_length:
warning: 100
error: 150
identifier_name:
allowed_symbols: ["_"] # these are allowed in type names
min_length: # only min_length
error: 3 # only error
max_length: 500
excluded: # excluded via string array
- vc
- app
- api
- id
- ids
- url
- URL
- all
- sut
- key
- i
- j
- day
- min
- sec
- max
- hex
- by
- from
- now
- hud
- lhs
- rhs
- low
- tab
- loc
- pan
- row
- fax
- exp
- arm
# from gists
- mib
- API
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, codeclimate, junit, html, emoji, sonarqube, markdown, github-actions-logging)
10 changes: 10 additions & 0 deletions Example/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@ target 'SnazzyList_Example' do
pod 'Nimble', '~> 8.0.7'
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf'
config.build_settings['ENABLE_BITCODE'] = 'NO'
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end
10 changes: 7 additions & 3 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ PODS:
- Nimble (8.0.9)
- Quick (2.2.1)
- SnazzyAccessibility (0.1.4)
- SnazzyList (0.1.0):
- SnazzyList (1.0.0):
- SnazzyAccessibility (= 0.1.4)
- SwiftLint
- SwiftLint (0.43.1)

DEPENDENCIES:
- Nimble (~> 8.0.7)
Expand All @@ -15,6 +17,7 @@ SPEC REPOS:
- Nimble
- Quick
- SnazzyAccessibility
- SwiftLint

EXTERNAL SOURCES:
SnazzyList:
Expand All @@ -24,8 +27,9 @@ SPEC CHECKSUMS:
Nimble: 98b888285a615fd34f20e61753cf58ea1402bde4
Quick: f5754d69b7013f5864c29aab9ae6f0c79c5bc200
SnazzyAccessibility: 1ccff42933e39cf9567477c8c2ed370dc0ff6017
SnazzyList: 56174e30c7c7e49fe4fbced0dbe6b02b3afabb3f
SnazzyList: 0cc474e22c98e0da49ce4096e54d37379216fca0
SwiftLint: 99f82d07b837b942dd563c668de129a03fc3fb52

PODFILE CHECKSUM: 40f31a85953578d54d26fabbec51e469025bb1ae
PODFILE CHECKSUM: c0bcca0cb7d0c9423032255f43ec7866f119162d

COCOAPODS: 1.10.1
9 changes: 6 additions & 3 deletions Example/Pods/Local Podspecs/SnazzyList.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b32bc54

Please sign in to comment.