All Projects β†’ IBDecodable β†’ Iblinter

IBDecodable / Iblinter

Licence: mit
A linter tool for Interface Builder

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Iblinter

Dockerfilelint
An opinionated Dockerfile linter.
Stars: ✭ 736 (-19.56%)
Mutual labels:  linter
Sublime Phpcs
πŸ” PHP CodeSniffer, PHP Coding Standard Fixer, Linter and Mess Detector Support for Sublime Text
Stars: ✭ 805 (-12.02%)
Mutual labels:  linter
Bpmn Js Bpmnlint
A bpmnlint plug-in for bpmn-js.
Stars: ✭ 26 (-97.16%)
Mutual labels:  linter
Pydocstyle
docstring style checker
Stars: ✭ 752 (-17.81%)
Mutual labels:  linter
Awesome Go Linters
A curated list of awesome Go linters. More than 60 linters and tools!
Stars: ✭ 801 (-12.46%)
Mutual labels:  linter
Lintr
Static Code Analysis for R
Stars: ✭ 817 (-10.71%)
Mutual labels:  linter
Interfacer
A linter that suggests interface types
Stars: ✭ 706 (-22.84%)
Mutual labels:  linter
Pyupgrade
A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language.
Stars: ✭ 883 (-3.5%)
Mutual labels:  linter
Jupyterlab Lsp
Coding assistance for JupyterLab (code navigation + hover suggestions + linters + autocompletion + rename) using Language Server Protocol
Stars: ✭ 796 (-13.01%)
Mutual labels:  linter
Cuke linter
A linting tool for Cucumber
Stars: ✭ 24 (-97.38%)
Mutual labels:  linter
Sonarts
Static code analyzer for TypeScript
Stars: ✭ 776 (-15.19%)
Mutual labels:  linter
Super Linter
Combination of multiple linters to install as a GitHub Action
Stars: ✭ 7,445 (+713.66%)
Mutual labels:  linter
Sonar Jproperties Plugin
SonarQube Java Properties Analyzer
Stars: ✭ 5 (-99.45%)
Mutual labels:  linter
Ls Lint
An extremely fast directory and filename linter - Bring some structure to your project directories
Stars: ✭ 745 (-18.58%)
Mutual labels:  linter
Sublimelinter Eslint
This linter plugin for SublimeLinter provides an interface to ESLint
Stars: ✭ 839 (-8.31%)
Mutual labels:  linter
Tslint
🚦 An extensible linter for the TypeScript language
Stars: ✭ 5,922 (+547.21%)
Mutual labels:  linter
Dotenv Linter
⚑️Lightning-fast linter for .env files. Written in Rust πŸ¦€
Stars: ✭ 802 (-12.35%)
Mutual labels:  linter
Eslint Closure
ESLint Plugin and Config for the Google JavaScript Style Guide
Stars: ✭ 21 (-97.7%)
Mutual labels:  linter
Go Critic
The most opinionated Go source code linter for code audit.
Stars: ✭ 875 (-4.37%)
Mutual labels:  linter
Dll
Go linter for finding defer statements inside for loops
Stars: ✭ 23 (-97.49%)
Mutual labels:  linter

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
Available commands:

   help      Display general or command-specific help
   lint      Print lint warnings and errors (default command)
   version   Display the current version of iblinter

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 byUseTraitCollectionsConfig`. If there is no config then use_trait_collections is set to true

key description
enabled true
enabled_rules:
  - relative_to_margin
  - use_trait_collections
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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].