{"id":13813439,"url":"https://github.com/markstory/lint-review","last_synced_at":"2025-10-04T10:49:52.011Z","repository":{"id":6483823,"uuid":"7724092","full_name":"markstory/lint-review","owner":"markstory","description":"An automated code linting bot that integrates various code lint tools with github pull requests.","archived":false,"fork":false,"pushed_at":"2022-01-06T22:23:37.000Z","size":16607,"stargazers_count":296,"open_issues_count":15,"forks_count":73,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-30T02:05:48.414Z","etag":null,"topics":["eslint","flask-application","javascript","linter","lua","php","phpcs","python","rubocop","ruby","tslint"],"latest_commit_sha":null,"homepage":"https://stickler-ci.com","language":"Python","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/markstory.png","metadata":{"files":{"readme":"README.mdown","changelog":null,"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":"2013-01-21T00:43:26.000Z","updated_at":"2024-12-17T21:40:52.000Z","dependencies_parsed_at":"2022-08-31T04:20:52.529Z","dependency_job_id":null,"html_url":"https://github.com/markstory/lint-review","commit_stats":null,"previous_names":[],"tags_count":202,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markstory%2Flint-review","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markstory%2Flint-review/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markstory%2Flint-review/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markstory%2Flint-review/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markstory","download_url":"https://codeload.github.com/markstory/lint-review/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427006,"owners_count":20937201,"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":["eslint","flask-application","javascript","linter","lua","php","phpcs","python","rubocop","ruby","tslint"],"created_at":"2024-08-04T04:01:17.762Z","updated_at":"2025-10-04T10:49:46.988Z","avatar_url":"https://github.com/markstory.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Lint Review\n\n[![Build Status](https://github.com/markstory/lint-review/workflows/ci/badge.svg)](https://github.com/markstory/lint-review/actions)\n[![codecov.io](https://codecov.io/github/markstory/lint-review/coverage.svg?branch=master)](https://codecov.io/github/markstory/lint-review?branch=master)\n[![Docker Pulls](https://img.shields.io/docker/pulls/markstory/lint-review.svg?maxAge=2592000)](https://hub.docker.com/r/markstory/lint-review/)\n[![Docker Stars](https://img.shields.io/docker/stars/markstory/lint-review.svg?maxAge=2592000)](https://hub.docker.com/r/markstory/lint-review/)\n\nLint Review helps automate a tedious part of code review - enforcing coding\nstandards. By using the GitHub API Lint Review runs a repository's configured linters\nand updates pull requests with line comments where lint errors would be introduced.\n\nLint Review requires:\n\n* Python 3.6+\n* RabbitMQ (or any other Message broker that is compatible with Celery)\n* A publically addressable hostname/IP that either GitHub or your github:enterprise\n  can reach.\n* A GitHub account with read/write access to the repositories you want linted. This\n  account is used to post comments on pull reviews.\n* Docker as all tools are executed in containers.\n\nLint Review runs as two processes. A web process handles accepting webhooks from\ngithub, and a celery process handles cloning repositories and running containers\nfor lint tools.\n\n## Hosted Lint Reviews\n\nIf you don't want to go through the trouble of setting up your own installation\nof lint-review, [stickler-ci.com provides a hosted version of\nlint-review](https://stickler-ci.com) featuring all the linters installed, and\nan easier to use YAML config file.\n\nIn the free plan, Stickler CI provides the following for open source projects:\n\n- Hosted service\n- Connection to public repositories\n- Commenting on style errors\n- Auto fixing for style errors\n- Clean user interface\n- Robust documentation\n- Automatic upgrades for linting tools.\n\nA paid plan of Stickler CI allows you to enable private repositories\nand fine grained access control to repositories via the GitHubApp integration.\n\n## Installation\n\nYou install Lint Review by cloning the repository and installing dependecies,\nor by using docker. If you are not using docker, it is recommended that you use\n`virtualenv` to save shaving yaks down the road.\n\n```bash\ngit clone git://github.com/markstory/lint-review.git\ncd lint-review\nvirtualenv env\nsource env/bin/activate\npip install .\n```\n\n## Make docker images for tools you want to use\n\nIn addition to installing the dependencies for lint-review you will also need to\nbuild the containers for each lint tool you want to use:\n\n```bash\n# Create a set of images for frequently used tools.\nmake images\n````\n\nOnce the dependencies are installed you should configure the repositories you\nwant to review.\n\n## Running lintreview services in Docker\n\nTo use docker, you'll need to install both docker, docker-compose and possibly\ndocker toolbox depending on your operating system. Once you have the docker\ninstalled, you can boot up lint-review into docker using:\n\n```bash\ndocker-compose up -d broker worker web\n```\n\nEdit `docker-compose.yml` and customise your configuration by setting keys under\nenvironment for the web and worker processes. For the most basic installation\nyou'll need to set `GITHUB_OAUTH_TOKEN`, and `LINTREVIEW_SERVER_NAME`.\n\n## Lint Review Configuration\n\nLint review is configured through a settings file. Both the web app and celery process\nshare the same configuration file, so configuration is easier to manage and share.\n\n* Copy the `settings.sample.py` to `settings.py`\n* Edit the required configuration options, or set the correct environment variables.\n* Set the `LINTREVIEW_SETTINGS` environment variable to the path\n  of your configuration files. In \\*nix system this can be done via:\n\n      export LINTREVIEW_SETTINGS='/path/to/settings.py'\n\n* You can skip setting `LINTREVIEW_SETTINGS` if you're running lintreview from\n  a directory containing your `settings.py` file.\n\nYou can also have per install configuration files by defining the\n`LINTRC_DEFAULTS` config option in your settings file. This file should be\na `.lintrc` config file. It will be merged with each projects `.lintrc` before\nrunning tools. This gives you an easy way to have global configuration for\ntools.\n\n## Setting up Repositories\n\nOnce you've configured the server processes, it is time to setup some\nrepositories to be checked.\n\n### Installing GitHub hooks\n\nBefore Lint Review can check pull requests on a repository webhooks will need\nto be installed.  You can install webhooks by running the built-in command line\ntool:\n\n```bash\nsource env/bin/activate\nlintreview register mark awesome-stuff\n```\n\nOr, if you're using Docker:\n\n```bash\ndocker-compose run web lintreview register mark awesome-stuff\n```\n\nThe above register webhooks for the given user \u0026 repository. You can use the\n`--user` and `--password` options to provide the repository admin credentials\nif the user lint-review runs as does not have admin access to the repository.\nYou can also use the cli tool to remove webhooks:\n\n```bash\nsource env/bin/activate\nlintreview unregister mark awesome-stuff\n```\n\n**Warning** The current web server name will be registered with github. Make sure\nit is configured properly before registering hooks, or you'll need to remove\nany registered hooks and start over.\n\n\n### .lintrc files\n\nLint Review use hidden ini files to configure the tools used on each project.\nThe `.lintrc` file defines the various linting tools and any arguments for each\none. Lint tools must be tools Lint Review knows about. See [lint\ntools](#lint-tools) for available tools. A sample `.lintrc` file would look\nlike.\n\n```ini\n[files]\nignore = generated/*\n    vendor/*\n\n[tools]\nlinters = pep8, jshint\n\n[tool_pep8]\nignore = W2,E401\n\n[tool_jshint]\nconfig = path/to/jshint.json\n```\n\nThe `[tools]` section is required, and `linters` should be a list of linters\nyour project uses.  Each tool can also have a section prefixed with `tool_` to\ndefine additional configuration options for each tool. The documentation for\neach tool outlines which options are supported.\n\nThe `[files]` section is optional and allows you to define ignore patterns.\nThese patterns are used to find and exclude files when doing a review. Ignore\npatterns use glob expressions to find files. The patterns start at the reviewed\nrepository root. If you need to ignore mulitple patterns separate them with new\nlines.\n\n\n## Running Lint Review\n\nAfter setting up configuration you'll need to start up both processes:\n\n```bash\nsource env/bin/activate\ngunicorn -c settings.py lintreview.web:app\ncelery -A lintreview.tasks worker\n```\n\nNow when ever a pull request is opened or updated for a registered repository\nnew jobs will be spun up and lint will be checked and commented on.\n\n\n## Lint tools\n\n### Python:\n\n#### Flake8\n\nUses the [flake8](http://pypi.python.org/pypi/flake8) module to check code.\n\n*Options*\n\n* `ignore` Set which pep8 error codes you wish to ignore.\n* `exclude` Exclude files matching these comma\n   separated patterns (default: .svn, CVS, .bzr, .hg, .git)\n* `filename` When parsing directories, only check filenames\n   matching these comma separated patterns (default: `*.py`)\n* `select` Select errors and warnings (e.g. E,W6)\n* `max-line-length` Set maximum allowed line length (default: 79)\n* `format` Set the error format [default|pylint|\u003ccustom\u003e]\n* `max-complexity` McCabe complexity threshold\n* `snippet` Interacts with\n  [flake8-snippets](https://pypi.python.org/pypi/flake8-snippets) allowing you\n  to trigger errors on specific snippets you want to disallow.\n\nThese options are passed into flake8 as cli options.\n\n#### pep8\n\nUses the [pep8](http://pypi.python.org/pypi/pep8/1.2) module to check code.\n\n*Options*\n\n* `ignore` Set which pep8 error codes you wish to ignore.\n* `exclude` Exclude files or directories which match these comma\n   separated patterns (default: .svn, CVS, .bzr, .hg, .git)\n* `filename` When parsing directories, only check filenames\n   matching these comma separated patterns (default: `*.py`)\n* `select` Select errors and warnings (e.g. E,W6)\n* `max-line-length` Set maximum allowed line length (default: 79)\n\n#### py3k\n\nUses [pylint](https://www.pylint.org/) to check for Python 3 compatibility\nissues.\n\n*Options*\n\n* `ignore` A comma separated list of error codes you wish to ignore.\n* `ignore-patterns` A comma separated list of regular expressions that match\n  files you want to ignore.\n\n#### pytype\n\nUses [pytype](https://opensource.google.com/projects/pytype) to check python\ncode using type annotations.\n\n*Options*\n\n* `config` Path to a config file for pytype.\n* `fixer` Enable automatic merging of inferred pyi files.\n\n### PHP\n\n#### PHPCS\n\nUses the [phpcs](http://pear.php.net/package/PHP_CodeSniffer) PEAR library\nto do style checks on PHP, Javascript and or CSS files.\n\n*Options*\n\n* `standard` The coding standard to use. By default the `PSR2` standard is used.\n  You can use any of the built-in standards or provide your own inside your\n  project directory.\n* `extensions` The extensions to check. By default only `.php` files will be\n  checked.\n* `ignore` A glob path of files to ignore.\n* `exclude` A comma separated list of sniffs to not apply.\n* `tab_width` The number of spaces to convert tabs into, this is useful for\n  projects using tabs for indentation.\n\n#### PHPMD\n\nUses the [phpmd](http://phpmd.org) tool to check code for messy or hard to\nmaintain code.\n\n*Options*\n\n* `ruleset` The ruleset names or file to use for phpmd. Defaults to `cleancode,codesize,unusedcode`\n\n### Javascript:\n\n#### JSHint\n\nUses the [jshint](http://jshint.org/) npm module to check javascript files. Before\nyou can use this linter you'll need to install nodejs and the jshint npm package:\n\n    cd path/to/lintreview\n    npm install jshint\n\n*Options*\n\n* `config` Provide a path to the json config file for jshint.\n\n#### ESLint\n\nUses the [eslint](http://eslint.org/) npm module to check javascript files. Before\nyou can use this linter you'll need to install the eslint npm package:\n\n    cd path/to/lintreview\n    npm install eslint\n\n*Options*\n\n* `config` Provide a path to the json config file for eslint.\n\n#### StandardJs\n\nUses the [standard](http://npmjs.org/package/standard) npm module to check javascript files. Before\nyou can use this linter you'll need to install nodejs and the standard npm package:\n\n*Options*\n\n* None currently supported\n\n#### JSON Lint\n\nUses the jsonlint script from [demjson](https://pypi.python.org/pypi/demjson) python module\nto check javascript object notation files.\n\n*Options*\n\n* None currently supported\n\n### TypeScript\n\n#### Tslint\n\nUses the [tslint](http://npmjs.org/package/tslint) tool to review TypeScript files. You need to\ninclude a `tslint.json` configuration file in your project or use the `config` option to provide\na path to a config file.\n\n*Options*\n\n* `config` The config file you want `tslint` to use.\n* `project` The tsc config file you want `tslint` to use.\n\n### CSS:\n\n#### CSSLint\n\nUses the [csslint](http://csslint.net/) npm module to check css files. Before\nyou can use this linter you'll need to install nodejs and the `csslint` npm package:\n\n    cd path/to/lintreview\n    npm install\n\nBoth warnings and errors will be turned into code review comments. If you don't want\ncode review comments for specific rules, you should ignore them.\n\n*Options*\n\n* `ignore` A comma separated list of rule ids to ignore.\n\n### SASS / SCSS\n\n#### scss-lint\n\nUses the [sass-lint](https://www.npmjs.com/package/sass-lint) npm module to check scss and sass files.\n\n*Options*\n\n* `ignore` A comma separated list of files to ignore.\n* `config` Project relative path to the sass-lint config file you want\n  applied.\n\n#### Stylelint\n\nUses [stylelint](https://github.com/stylelint/stylelint) to check, scss, sass,\nless or css files.\n\n*Options*\n\n* `config` Provide a path to your stylelint configuration file. If none is\n  provided then stylelint's default config file lookup behavior will be used,\n  and falling back to the `stylelint-config-recommended` will be used.\n\n\n### Ruby:\n\n#### RuboCop\n\nUses the [rubocop](http://rubygems.org/gems/rubocop) gem to check ruby files.\nYou'll need to install it to use it:\n\n    gem install rubocop\n\n*Options*\n\n* `display_cop_names` Set to `true` to pass display cop names in offense messages.\n\n`.rubocop.yml` files will be respected, as described\n[here](https://github.com/bbatsov/rubocop#configuration).\n\n### Puppet:\n\n#### puppet-lint\n\nUses the [puppet-lint](http://rubygems.org/gems/rubocop) gem to check puppet manifests\nagainst the puppetlabs style guide.\n\nYou'll need to install it to use it:\n\n    gem install puppet-lint\n\n*Options*\n\n* `config` Provide a path to a puppet-lint config file.\n* `fixer_ignore` A comma separated list of linter checks to ignore when running\n  the fixer.\n\n`.puppet-lint.rc` files will also be respected, to allow each project to disable\nchecks. A list of checks can be found by running \"puppet-lint --help\"\n\n### Chef:\n\n#### Foodcritic\n\nUses the [Foodcritic](http://www.foodcritic.io/) gem to check Chef files.\nYou'll need to install Foodcritic:\n\n    gem install foodcritic\n\n*Options*\n\n* `path` If your cookbooks aren't stored in the root, use this to set the path\n  that foodcritic runs against. Example: `path = cookbooks`\n\n### Yet Another Markup Language:\n\n#### yamllint\n\nUses the [yamllint](http://pypi.python.org/pypi/yamllint) module to check yaml and yml files.\n\n*Options*\n\n* `config` Provide a path to the yaml config file for yamlhint.\n\n### Shell\n\n#### Shellcheck\n\nUses [shellcheck](https://github.com/koalaman/shellcheck) to lint shell scripts.\n\n*Options*\n\n* `shell` Select which shell to use. Options are: bash, sh, ksh or zsh. Default: `sh`\n* `exclude` String of checks to ignore. Example: SC2154,SC2069\n\n### Ansible\n\n#### Ansible-lint\n\nUses [ansible-lint](https://github.com/willthames/ansible-lint) to lint Ansible plays.\n\n*Options*\n\n* `ignore` Set which ansible-lint error codes you wish to ignore.\n\n### Go lang\n\n#### Golint\n\nUses [go-lint](https://github.com/golang/lint) to lint go code.\n\n*Options*\n\n* `min_confidence` Set the confidence level of a problem before it is reported.\n* `ignore` A list of regular expressions, that allow you to ignore warnings.\n\n\n### Kotlin\n\n#### Ktlint\n\nUses [ktlint](https://github.com/pinterest/ktlint) to lint kotlin code.\n\n*Options*\n\n* `android` Set to `true` to pass rule set in error messages.\n* `config` Provide a path to the [.editorconfig](https://github.com/pinterest/ktlint/#EditorConfig) file for ktlint.\n* `experimental` Set to `true` to add [`experimental rules`](https://github.com/pinterest/ktlint/#experimental-rules).\n* `fixer` Set to `true` to fix any deviations from the code style\n* `ruleset` Provide [\"ruleset\"](https://github.com/pinterest/ktlint/#experimental-rules) a path to JAR containing one or more [Rule](https://github.com/pinterest/ktlint/blob/master/ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/Rule.kt)s gathered together in a [RuleSet](https://github.com/pinterest/ktlint/blob/master/ktlint-core/src/main/kotlin/com/github/shyiko/ktlint/core/RuleSet.kt).\n\n\n### Lua\n\n#### Luacheck\n\nUses [luacheck](https://github.com/mpeterv/luacheck) to lint Lua code.\n\n*Options*\n\n* `config` Provide a path to the config file for luacheck.\n\n\n### Elixir\n\n#### Credo\n\nUses [credo](https://github.com/rrrene/credo) to lint Elixir code. Runs `mix\ncredo list` to get results by files.\n\n*Options*\n\n* `checks` Only include checks that match the given strings\n* `config-name` Use the given config instead of \"default\"\n* `ignore-checks` Ignore checks that match the given strings\n* `all` Show all issues\n* `all-priorities` Show all issues including low priority ones\n* `strict` Show all issues and all priorities\n\n\n### Markdown\n\n#### Remarklint\n\nUses [remark-lint](https://github.com/remarkjs/remark-lint) to lint markdown\nfiles. Will use the `.remarkrc` files in your project. \nThe `remark-preset-lint-recommended` package is installed, other presets require\ncustomizing the nodejs docker image.\n\n*Options*\n\n* No options at this time.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkstory%2Flint-review","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkstory%2Flint-review","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkstory%2Flint-review/lists"}