Disable trailing_comma on allRules collection (#183)
Disable SwiftLint trailing_comma rule
Add trailing common to allRules collection to avoid spurious differences in code review
Disable SwiftLint trailing_comma rule
Co-authored-by: Max Air Toto max_air_toto@toto.net
IBLinter
A linter tool to normalize
.xib
and.storyboard
files. Inspired by realm/SwiftLintInstallation
Using Homebrew
Using Mint
Using CocoaPods
This will download the IBLinter binaries and dependencies in
Pods/
during your nextpod install
execution and will allow you to invoke it via${PODS_ROOT}/IBLinter/bin/iblinter
in your Script Build Phases.Compiling from source
You can build from source by cloning this repository and running
iblinter
will be installed in/usr/local/bin
.Usage
You can see all description by
iblinter --help
Xcode
Add a
Run Script Phase
to integrate IBLinter with XcodeAlternatively, if you’ve installed IBLinter via CocoaPods the script should look like this:
Requirements
IBLinter requires Swift5.0 runtime. Please satisfy at least one of following requirements.
Swift 5 Runtime Support for Command Line Tools
from More Downloads for Apple DevelopersRules
All rules are documented in Rules.md
Pull requests are encouraged.
Configuration
You can configure IBLinter by adding a
.iblinter.yml
file from project root directory.enabled_rules
disabled_rules
excluded
included
custom_module_rule
use_base_class_rule
view_as_device_rule
CustomModuleConfig
You can configure
custom_module
rule byCustomModuleConfig
list.module
included
*.swift
classes of the module forcustom_module
lint.excluded
*.swift
classes of the module forcustom_module
lint.UseBaseClassConfig
You can configure
use_base_class
rule byUseBaseClassConfig
list.element_class
base_classes
Note: UseBaseClassRule does not work for classes that inherit base class. You need to add all classes to
base_classes
to check.ViewAsDeviceConfig
You can configure
view_as_device
rule byViewAsDeviceConfig
. If there are no config,device_id
is set asretina4_7
.device_id
appx. Table of mapping device name to
device_id
(onXcode 10.2
)iPhone 4s
retina3_5
iPhone SE
retina4_0
iPhone 8
retina4_7
iPhone 8 Plus
retina5_5
iPhone XS
retina5_9
iPhone XR
retina6_1
iPhone XS Max
retina6_5
UseTraitCollectionsConfig
You can configure
use_trait_collections
rule byUseTraitCollectionsConfig
. If there is no config then use_trait_collections is set to truetrue
HidesBottomBarConfig
You can configure
hides_bottom_bar
rule byHidesBottomBarConfig
list.excluded_view_controllers
hides_bottom_bar
rule.