{"id":896,"url":"https://github.com/IBDecodable/IBLinter","last_synced_at":"2025-08-06T14:31:33.630Z","repository":{"id":27545770,"uuid":"113841451","full_name":"IBDecodable/IBLinter","owner":"IBDecodable","description":"A linter tool for Interface Builder","archived":false,"fork":false,"pushed_at":"2022-10-05T01:05:38.000Z","size":16486,"stargazers_count":948,"open_issues_count":14,"forks_count":42,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-11-16T00:47:08.449Z","etag":null,"topics":["ib","linter","storyboard"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IBDecodable.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-11T09:52:40.000Z","updated_at":"2024-11-02T18:01:45.000Z","dependencies_parsed_at":"2022-07-08T05:59:10.873Z","dependency_job_id":null,"html_url":"https://github.com/IBDecodable/IBLinter","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IBDecodable%2FIBLinter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IBDecodable%2FIBLinter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IBDecodable%2FIBLinter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IBDecodable%2FIBLinter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IBDecodable","download_url":"https://codeload.github.com/IBDecodable/IBLinter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228905551,"owners_count":17989782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ib","linter","storyboard"],"created_at":"2024-01-05T20:15:34.147Z","updated_at":"2024-12-09T14:31:19.426Z","avatar_url":"https://github.com/IBDecodable.png","language":"Swift","funding_links":[],"categories":["Code Quality","Libs","Swift","HarmonyOS","技术方向","Quality [🔝](#readme)"],"sub_categories":["Linter","Quality","Windows Manager","Other free courses","iOS"],"readme":"# IBLinter\n[![Build Status](https://travis-ci.org/IBDecodable/IBLinter.svg?branch=master)](https://travis-ci.org/IBDecodable/IBLinter)\n[![Swift 5.0](https://img.shields.io/badge/Swift-5.0-orange.svg?style=flat)](https://developer.apple.com/swift/)\n\n\nA linter tool to normalize `.xib` and `.storyboard` files. Inspired by [realm/SwiftLint](https://github.com/realm/SwiftLint)\n\n![](assets/warning.png)\n\n## Installation\n\n### Using [Homebrew](http://brew.sh/)\n\n```sh\n$ brew install iblinter\n```\n\n### Using [Mint](https://github.com/yonaskolb/Mint)\n\n```sh\n$ mint install IBDecodable/IBLinter\n```\n\n### Using [CocoaPods](https://cocoapods.org)\n\n```sh\npod 'IBLinter'\n```\n\nThis will download the IBLinter binaries and dependencies in `Pods/` during your next\n`pod install` execution and will allow you to invoke it via `${PODS_ROOT}/IBLinter/bin/iblinter`\nin your Script Build Phases.\n\n### Compiling from source\n\nYou can build from source by cloning this repository and running\n```\n$ make install\n```\n`iblinter` will be installed in `/usr/local/bin`.\n\n## Usage\n\nYou can see all description by `iblinter --help`\n\n```\n$ iblinter --help\nUSAGE: iblinter \u003csubcommand\u003e\n\nOPTIONS:\n  --version               Show the version.\n  -h, --help              Show help information.\n\nSUBCOMMANDS:\n  lint (default)          Print lint warnings and errors\n\n  See 'iblinter help \u003csubcommand\u003e' for detailed help.\n```\n\n### Xcode\n\nAdd a `Run Script Phase` to integrate IBLinter with Xcode\n\n```sh\nif which iblinter \u003e/dev/null; then\n  iblinter lint\nelse\n  echo \"warning: IBLinter not installed, download from https://github.com/IBDecodable/IBLinter\"\nfi\n```\n\nAlternatively, if you've installed IBLinter via CocoaPods the script should look like this:\n\n```sh\n\"${PODS_ROOT}/IBLinter/bin/iblinter\"\n```\n\n## Requirements\n\nIBLinter requires Swift5.0 runtime. Please satisfy at least one of following requirements.\n\n - macOS 10.14.4 or later\n - Install `Swift 5 Runtime Support for Command Line Tools` from [More Downloads for Apple Developers](https://developer.apple.com/download/more/)\n\n## Rules\n\nAll rules are documented in [Rules.md](Rules.md)\n\nPull requests are encouraged.\n\n\n## Configuration\n\nYou can configure IBLinter by adding a `.iblinter.yml` file from project root directory.\n\n\n| key                  | description                 |\n|:---------------------|:--------------------------- |\n| `enabled_rules`      | Enabled rules id.           |\n| `disabled_rules`     | Disabled rules id.          |\n| `excluded`           | Path to ignore for lint.    |\n| `included`           | Path to include for lint.   |\n| `custom_module_rule` | Custom module rule configs. |\n| `use_base_class_rule`| Use base class rule configs.|\n| `view_as_device_rule`| View as device rule configs.|\n\n### CustomModuleConfig\n\nYou can configure `custom_module` rule by `CustomModuleConfig` list.\n\n| key        | description                                                                  |\n|:-----------|:---------------------------------------------------------------------------- |\n| `module`   | Module name.                                                                 |\n| `included` | Path to `*.swift` classes of the module for `custom_module` lint.            |\n| `excluded` | Path to ignore for `*.swift` classes of the module for `custom_module` lint. |\n\n### UseBaseClassConfig\n\nYou can configure `use_base_class` rule by `UseBaseClassConfig` list.\n\n| key               | description                        |\n|:------------------|:---------------------------------- |\n| `element_class`   | Element class name.                |\n| `base_classes`    | Base classes of the element class. |\n\n**Note:** UseBaseClassRule does not work for classes that inherit base class. You need to add all classes to `base_classes` to check.\n\n### ViewAsDeviceConfig\n\nYou can configure `view_as_device` rule by `ViewAsDeviceConfig`. If there are no config, `device_id` is set as `retina4_7`.  \n\n| key               | description                        |\n|:------------------|:---------------------------------- |\n| `device_id`       | Device id for device.              |\n\n**appx.** Table of mapping device name to `device_id` (on `Xcode 10.2`) \n\n| device name       | device id            |\n|:------------------|:-------------------- |\n| `iPhone 4s`       | `retina3_5`          |\n| `iPhone SE`       | `retina4_0`          |\n| `iPhone 8`        | `retina4_7`          |\n| `iPhone 8 Plus`   | `retina5_5`          |\n| `iPhone XS`       | `retina5_9`          |\n| `iPhone XR`       | `retina6_1`          |\n| `iPhone XS Max`   | `retina6_5`          |\n\n### UseTraitCollectionsConfig\n\nYou can configure `use_trait_collections` rule by `UseTraitCollectionsConfig`. If there is no config then use_trait_collections is set to true\n\n|    key   | description |\n|:---------------:|:---------------:|\n|   enabled  |  `true` |\n\n### HidesBottomBarConfig\n\nYou can configure `hides_bottom_bar` rule by `HidesBottomBarConfig` list.\n\n|    key   | description |\n|:---------------:|:---------------:|\n|   `excluded_view_controllers`  |  Controller's class name to ignore `hides_bottom_bar` rule. |\n\n```yaml\nenabled_rules:\n  - relative_to_margin\n  - use_trait_collections\n  - hides_bottom_bar\n  - has_single_view_controller\n  - has_initial_view_controller\ndisabled_rules:\n  - custom_class_name\nexcluded:\n  - Carthage\n  - App\nincluded:\n  - App/Views\ncustom_module_rule:\n  - module: UIComponents\n    included:\n      - UIComponents/Classes\n    excluded:\n      - UIComponents/Classes/Config/Generated\nuse_base_class_rule:\n  - element_class: UILabel\n    base_classes:\n      - PrimaryLabel\n      - SecondaryLabel\nview_as_device_rule:\n  device_id: retina4_0\nuse_trait_collections_rule:\n  enabled: false\nhides_bottom_bar_rule:\n  excluded_view_controllers:\n    - FirstViewController\n    - SecondViewController\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIBDecodable%2FIBLinter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FIBDecodable%2FIBLinter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FIBDecodable%2FIBLinter/lists"}