Name: arcanist-linters
Owner: Pinterest
Description: A collection of custom Arcanist linters
Created: 2016-04-21 22:31:26.0
Updated: 2018-05-04 02:31:56.0
Pushed: 2018-04-16 20:28:49.0
Size: 43
Language: PHP
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is a collection of custom Arcanist linters that we've written at Pinterest.
Lints for errors in Apache Thrift IDL (schema) files using the thrift
compiler.
"type": "thrift",
"include": "(\\.thrift$)",
"flags": [
"--allow-64bit-consts"
],
"version": ">= 0.9.0",
"thrift.generators": [
"py:dynamic,utf8strings,new_style,slots",
"java",
"go",
"erl"
],
"thrift.includes": [
".",
"common"
]
Lints files generated by the Apache Thrift compiler to ensure they were generated using a supported Thrift compiler.
"type": "thrift-gen",
"include": "(^schemas/.*\\.py$)",
"thrift-gen.version": ">=0.9.3"
Note: Currently only generated Python files are supported.
Uses the Checkstyle tool to check Java code against a coding standard.
"type": "checkstyle",
"include": "(\\.java$)",
"checkstyle.config": "google_check.xml"
Lints JavaScript and JSX files using ESLint.
"type": "eslint",
"include": "(\\.js$)",
"bin": "./node_modules/.bin/eslint",
"eslint.config": "~/my-eslint.json",
"eslint.env": "browser,node"
Uses the Go vet command to lint for suspicious code constructs.
"type": "govet",
"include": "(^src/example.com/.*\\.go$)"
Formats JavaScript using Prettier.
"type": "prettier",
"include": "(\\.js$)",
"bin": "./node_modules/.bin/prettier",
"prettier.cwd": "./"
Formats JavaScript using Prettier and then fixes with ESLint.
"type": "prettier-eslint",
"include": "(\\.js$)",
"bin": "./node_modules/.bin/prettier-eslint",
"prettier-eslint.cwd": "./"
Lints for illegal Python module imports.
"type": "python-imports",
"python-imports.pattern": "(mock)",
"include": "(\\.py$)",
"exclude": "(^tests/)"
Lints Python imports using isort.
"type": "isort",
"include": "(\\.py$)"
Ensures Python package requirements in requirements.txt files are sorted, unique, and pinned to exact versions.
"type": "requirements-txt",
"include": "(requirements.txt$)"
Individual requirement lines can be excluded by adding a # noqa
comment:
=1.10.0 # noqa: allow any recent version of six
In short, you'll need to add this repository to your local machine and tell Arcanist to load the extension. You either can do this globally or on a per-project basis.
Once installed, the individual linters can be enabled and configured via the
project's .arclint
file. See the Arcanist Lint User Guide for
details.
Arcanist can load modules from an absolute path, but because it also searches
for modules one level up from itself on the filesystem, it's convenient to
clone this repository at the same level as arcanist
and libphutil
.
t clone https://github.com/pinterest/arcanist-linters.git pinterest-linters
nist
erest-linters
hutil
Then, tell Arcanist to load the module by editing ~/.arcconfig
(or
/etc/arcconfig
):
oad": ["pinterest-linters"]
You can also load arcanist-linters
on a per-project basis. In that case,
using a git submodule is probably
the most convenient approach.
t submodule add https://github.com/pinterest/arcanist-linters.git .pinterest-linters
t submodule update --init
Then, enable the module in your project-level .arcconfig
file:
oad": [".pinterest-linters"]