• Stars
    star
    522
  • Rank 84,318 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created almost 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A tool for linting storyboard and xib files

xiblint

The xiblint script will test .xib and .storyboard files for compliance with best practices and team policies.

The linter messages contain the position within the XML files, and if applicable, an Object ID which can be used in conjunction with Xcode's Find in Workspace to jump to the problematic object in the .xib or .storyboard file.

Rules

  • accessibility_format

    Checks for incorrect use of Lyft extensions accessibilityFormat and accessibilitySources.

  • accessibility_labels_for_images

    Checks for images with accessibility enabled and no accessibility label. In this case, VoiceOver will announce the image asset's name, which might be unwanted.

  • accessibility_labels_for_image_buttons

    Checks for image buttons with no accessibility label. In this case, VoiceOver will announce the image asset's name, which might be unwanted.

  • accessibility_labels_for_text_with_placeholder

    Checks for text fields and views with a placeholder and no accessibility label. This addresses common confusion about placeholderText coming instead of accessibilityLabel.

  • autolayout_frames

    Checks for ambiguous and misplaced views.

  • automation_identifiers

    Makes sure that interactive views have accessibility identifiers, to support testing through UI Automation.

  • automation_identifiers_for_outlet_labels

    Checks for labels with outlets into a view controller that have no accessibility identifiers. Labels with outlets might get dynamic text, and therefore should be accessible to UI testing.

  • enforce_runtime_attributes

    Ensures a runtime attribute is set to one of the allowed values. Configure runtime_attributes in a custom rule configuration using rules_config (see below). Use null as an option to allow no value.

  • enforce_system_properties

    Ensures a property in a system type is set to one of the allowed values. Configure system_properties in a custom rule configuration using rules_config (see below). Use null as an option to allow default value.

  • named_colors

    Ensures all colors are using named colors from an asset catalog. Configure allowed_colors to limit the colors to a subset (default is all named colors are allowed), allow_system_colors (default is false), allow_clear_color (default is false) and ignore_alpha (default is false) in a custom rule configuration using rules_config (see below).

  • no_trait_variations

    Ensures Trait Variations are disabled.

  • simulated_metrics_retina4_0

    Ensures simulated metrics are for the iPhone SE, which is currently the smallest display profile.

  • no_view_controller_links_to_other_bundles

    Ensures there are no links to other storyboards in different bundles.

  • strict_fonts

    Ensures all font names and sizes are in an allowed set. Configure allowed_fonts with an array of dictionaries containing a name and size in a custom rule configuration using rules_config (see below).

  • strict_font_names

    Ensures all font namess are in an allowed set. Configure allowed_fonts and allow_system_fonts (default is true) in a custom rule configuration using rules_config (see below). This is a good option if strict_fonts is too strict.

  • strict_font_sizes

    Ensures all font sizes are above a minimum font size. Configure minimum_size (default is 0) and/or maximum_size (default is 1000) in a custom rule configuration using rules_config (see below). This is a good option if strict_fonts is too strict.

  • unavailable_custom_classes

    Prevent a list of classes from appearing as custom classes. Configure custom_classes in a custom rule configuration using rules_config (see below). This is a mapping of the full name of the class (ModuleName.ClassName) to the suggested replacement.

  • unavailable_system_classes

    Ensures a system type uses a set of custom clases. Configure system_classes in a custom rule configuration using rules_config (see below).

Usage

For a list of available rules, run xiblint -h.

Place a configuration file named .xiblint.json into the root of your source repository. A sample configuration file would be:

{
  "rules": [
    "accessibility_format",
    "autolayout_frames"
  ],
  "paths": {
    "Pods": {
      "rules": []
    },
    "InaccessibleFeature": {
      "excluded_rules": [
        "accessibility_*"
      ]
    },
    "Modules": {
      "rules": ["some_rule"],
      "rules_config": {
        "some_rule": {
          "some_rule_specific_option": true
        }
      }
    }
  }
}

Then simply invoke xiblint in the source repository.

--reporter

If you find yourself in need of a different structure of the output, there is the --reporter option. You are able to choose from the default one, raw, or a json one. To switch between them, use the following:

xiblint --reporter json
xiblint --reporter raw

Specyfing paths

Sometimes you want to lint only a few files and forget about the rest - for instance, when you want to lint only delta changes. For this case you can specify your files after the xiblint command:

xiblint "Project/Base.lproj/LaunchScreen.storyboard" "Project/Base.lproj/Main.storyboard"

If you want to combine paths with the reporter option, don't forget to put the option before listing the paths:

xiblint --reporter json "Project/Base.lproj/LaunchScreen.storyboard" "Project/Base.lproj/Main.storyboard"

Installation

Using pip:

pip install xiblint

Manual:

git clone https://github.com/lyft/xiblint.git
cd xiblint && python setup.py install

Contributing

Code of conduct

This project is governed by Lyft's code of conduct. All contributors and participants agree to abide by its terms.

Sign the Contributor License Agreement (CLA)

We require a CLA for code contributions, so before we can accept a pull request we need to have a signed CLA. Please visit our CLA service and follow the instructions to sign the CLA.

File issues in GitHub

Use GitHub issue to file bugs or enhancement requests. You may also use GitHub issues to discuss before implementing a change.

Submit pull requests

Our only method of accepting code changes is through GitHub pull requests.

More Repositories

1

cartography

Cartography is a Python tool that consolidates infrastructure assets and the relationships between them in an intuitive graph view powered by a Neo4j database.
Python
2,949
star
2

scissors

✂ Android image cropping library
Java
1,841
star
3

confidant

Confidant: your secret keeper. https://lyft.github.io/confidant
Python
1,781
star
4

clutch

Extensible platform for infrastructure management
Go
1,643
star
5

react-javascript-to-typescript-transform

Convert React JavaScript code to TypeScript with proper typing
TypeScript
1,574
star
6

mapper

A JSON deserialization library for Swift
Swift
1,174
star
7

scoop

🍦 micro framework for building view based modular Android applications.
Java
1,036
star
8

Hammer

iOS touch synthesis library
Swift
642
star
9

protoc-gen-star

protoc plugin library for efficient proto-based code generation
Go
563
star
10

flinkk8soperator

Kubernetes operator that provides control plane for managing Apache Flink applications
Go
508
star
11

domic

Reactive Virtual DOM for Android.
Kotlin
482
star
12

metadataproxy

A proxy for AWS's metadata service that gives out scoped IAM credentials from STS
Python
450
star
13

cni-ipvlan-vpc-k8s

AWS VPC Kubernetes CNI driver using IPvlan
Go
357
star
14

nuscenes-devkit

Devkit for the public 2019 Lyft Level 5 AV Dataset (fork of https://github.com/nutonomy/nuscenes-devkit)
Jupyter Notebook
352
star
15

presto-gateway

A load balancer / proxy / gateway for prestodb
JavaScript
337
star
16

toasted-marshmallow

S'More speed for Marshmallow
Python
297
star
17

Kronos-Android

An Open Source Kotlin SNTP library
Kotlin
239
star
18

coloralgorithm

Javacript function to produce color sets
JavaScript
225
star
19

awspricing

Python library for AWS pricing.
Python
201
star
20

discovery

This service provides a REST interface for querying for the list of hosts that belong to all microservices.
Python
185
star
21

linty_fresh

✨ Surface lint errors during code review
Python
183
star
22

universal-async-component

React Universal Async Component that works with server side rendering
TypeScript
180
star
23

python-blessclient

Python client for fetching BLESS certificates
Python
112
star
24

goruntime

Go client for Runtime application level feature flags and configuration
Go
84
star
25

omnibot

One slackbot to rule them all
Python
80
star
26

lyft-android-sdk

Public Lyft SDK for Android
Java
72
star
27

high-entropy-string

A library for classifying strings as potential secrets.
Python
60
star
28

gostats

Go client for Stats
Go
56
star
29

pynamodb-attributes

Common attributes for PynamoDB
Python
52
star
30

bandit-high-entropy-string

A high entropy string plugin for OpenStack's bandit project
Python
48
star
31

Lyft-iOS-sdk

Public Lyft SDK for iOS
Swift
43
star
32

python-kmsauth

A python library for reusing KMS for your own authentication and authorization
Python
38
star
33

opsreview

Compile a report of recent PagerDuty alerts for a single escalation policy.
Python
29
star
34

atlantis

Terraform automation for GitHub PRs (private fork of runatlantis/atlantis)
Go
18
star
35

lyft-node-sdk

Node SDK for the Lyft Public API
JavaScript
16
star
36

fake_sqs

An implementation of a local SQS service.
Ruby
15
star
37

lyft.github.io

This is code for oss.lyft.com website.
TypeScript
14
star
38

dockernetes

Run kubernetes inside a docker container.
Dockerfile
12
star
39

kustomizer

A container for running k8s kustomize
Shell
11
star
40

python-confidant-client

Client library and CLI for Confidant
Python
11
star
41

collectd-statsd

collectd plugin to write to statsd
Python
10
star
42

lyft-web-button

Build an actionable, Lyft-branded button for your website
JavaScript
9
star
43

dynamodb-hive-serde

Hive Deserializer for DynamoDB backup data format
Java
8
star
44

syx

Python 2 and 3 compatibility library from Lyft.
Python
7
star
45

lyft-node-samples

Sample applications using Node.js for the Lyft Public API
JavaScript
7
star
46

android-puzzlers

Android puzzles for Lyft Talks and more.
Java
6
star
47

lyft-go-sdk

Go SDK for the Lyft Public API
Go
6
star
48

lyft-django-sample

An API integration example using Django and social-auth.
Python
5
star
49

python-omnibot-receiver

Library for use by services that receive messages from omnibot.
Python
4
star
50

osscla

Open Source Contributor License Agreement service
Python
4
star
51

code-of-conduct

Code of Conduct for Lyft's open source projects
3
star
52

CLA

Contributor License Agreement (CLA) for Lyft's open source projects
3
star
53

awseipext

AWS Lambda that extends the EC2 Elastic IP API
Python
3
star
54

heroku-buildpack-php

Shell
2
star
55

lyft-go-samples

Sample applications in Go for the Lyft Public API
Go
1
star
56

flask-pystatsd

flask extension to simplify the use of the pystatsd library
Python
1
star
57

eventbot

A slackbot to help organize events
Python
1
star