ProductPromotion
Logo

Swift

made by https://0x3d.site

GitHub - IBDecodable/IBLinter: A linter tool for Interface Builder
A linter tool for Interface Builder. Contribute to IBDecodable/IBLinter development by creating an account on GitHub.
Visit Site

GitHub - IBDecodable/IBLinter: A linter tool for Interface Builder

GitHub - IBDecodable/IBLinter: A linter tool for Interface Builder

IBLinter

Build Status Swift 5.0

A linter tool to normalize .xib and .storyboard files. Inspired by realm/SwiftLint

Installation

Using Homebrew

$ brew install iblinter

Using Mint

$ mint install IBDecodable/IBLinter

Using CocoaPods

pod 'IBLinter'

This will download the IBLinter binaries and dependencies in Pods/ during your next pod 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

$ make install

iblinter will be installed in /usr/local/bin.

Usage

You can see all description by iblinter --help

$ iblinter --help
USAGE: iblinter <subcommand>

OPTIONS:
  --version               Show the version.
  -h, --help              Show help information.

SUBCOMMANDS:
  lint (default)          Print lint warnings and errors

  See 'iblinter help <subcommand>' for detailed help.

Xcode

Add a Run Script Phase to integrate IBLinter with Xcode

if which iblinter >/dev/null; then
  iblinter lint
else
  echo "warning: IBLinter not installed, download from https://github.com/IBDecodable/IBLinter"
fi

Alternatively, if you've installed IBLinter via CocoaPods the script should look like this:

"${PODS_ROOT}/IBLinter/bin/iblinter"

Requirements

IBLinter requires Swift5.0 runtime. Please satisfy at least one of following requirements.

Rules

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.

key description
enabled_rules Enabled rules id.
disabled_rules Disabled rules id.
excluded Path to ignore for lint.
included Path to include for lint.
custom_module_rule Custom module rule configs.
use_base_class_rule Use base class rule configs.
view_as_device_rule View as device rule configs.

CustomModuleConfig

You can configure custom_module rule by CustomModuleConfig list.

key description
module Module name.
included Path to *.swift classes of the module for custom_module lint.
excluded Path to ignore for *.swift classes of the module for custom_module lint.

UseBaseClassConfig

You can configure use_base_class rule by UseBaseClassConfig list.

key description
element_class Element class name.
base_classes Base classes of the element class.

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 by ViewAsDeviceConfig. If there are no config, device_id is set as retina4_7.

key description
device_id Device id for device.

appx. Table of mapping device name to device_id (on Xcode 10.2)

device name device id
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 by UseTraitCollectionsConfig. If there is no config then use_trait_collections is set to true

key description
enabled true

HidesBottomBarConfig

You can configure hides_bottom_bar rule by HidesBottomBarConfig list.

key description
excluded_view_controllers Controller's class name to ignore hides_bottom_bar rule.
enabled_rules:
  - relative_to_margin
  - use_trait_collections
  - hides_bottom_bar
  - has_single_view_controller
  - has_initial_view_controller
disabled_rules:
  - custom_class_name
excluded:
  - Carthage
  - App
included:
  - App/Views
custom_module_rule:
  - module: UIComponents
    included:
      - UIComponents/Classes
    excluded:
      - UIComponents/Classes/Config/Generated
use_base_class_rule:
  - element_class: UILabel
    base_classes:
      - PrimaryLabel
      - SecondaryLabel
view_as_device_rule:
  device_id: retina4_0
use_trait_collections_rule:
  enabled: false
hides_bottom_bar_rule:
  excluded_view_controllers:
    - FirstViewController
    - SecondViewController

More Resources
to explore the angular.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory