Git Product home page Git Product logo

arc-regex-line-length-linter's Introduction

regex-line-length linter for arc

regex-line-length is a linter for use with Phabricator's arc command line tool. This linter is able to identify lines that exceed a certain length while ignoring lines that match a list of regexes.

Installation

Project-specific

Add this repository as a git submodule.

git submodule init
git submodule add <url for this repo>

Your .arcconfig should list arc-regex-line-length-lint in the load configuration:

{
  "load": [
    "path/to/arc-regex-line-length-lint"
  ]
}

Global

Clone this repository to the same directory where arcanist and libphutil are globally located. Your directory structure will look like so:

arcanist/
libphutil/
arc-proselint/

Your .arcconfig should list arc-regex-line-length-lint in the load configuration (without a path):

{
  "load": [
    "arc-regex-line-length-lint"
  ]
}

Usage

Create a .arclint file in the root of your project and add the following content:

{
  "line-length": {
    "type": "regex-line-length"
  },
}

Feel free to change the include/exclude regexes to suit your project's needs.

Configuration options

Line length can be configured by providing a max-line-length number:

{
  "line-length": {
    "type": "regex-line-length",
    "max-line-length": 100
  },
}

Lines can be ignored if they match a given list of regexes. In the following example we ignore lines that include a url.

{
  "line-length": {
    "type": "regex-line-length",
    "ignore-line-regexes": [
      "(https?://)"
    ]
  },
}

License

Licensed under the Apache 2.0 license. See LICENSE for details.

arc-regex-line-length-linter's People

Contributors

jverkoey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.