{"id":13990513,"url":"https://github.com/grantmcconnaughey/Lintly","last_synced_at":"2025-07-22T12:32:56.472Z","repository":{"id":43798362,"uuid":"132828575","full_name":"grantmcconnaughey/Lintly","owner":"grantmcconnaughey","description":"Automated GitHub PR code reviewer for Python, JavaScript, CSS, and more.","archived":false,"fork":false,"pushed_at":"2022-07-11T18:53:30.000Z","size":748,"stargazers_count":89,"open_issues_count":23,"forks_count":20,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-25T01:08:16.100Z","etag":null,"topics":["ci-platforms","cli","github-pr-review","linter","python"],"latest_commit_sha":null,"homepage":"","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/grantmcconnaughey.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":"2018-05-10T00:48:08.000Z","updated_at":"2024-04-12T20:43:42.000Z","dependencies_parsed_at":"2022-08-31T20:01:27.829Z","dependency_job_id":null,"html_url":"https://github.com/grantmcconnaughey/Lintly","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantmcconnaughey%2FLintly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantmcconnaughey%2FLintly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantmcconnaughey%2FLintly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grantmcconnaughey%2FLintly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grantmcconnaughey","download_url":"https://codeload.github.com/grantmcconnaughey/Lintly/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227098832,"owners_count":17730645,"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":["ci-platforms","cli","github-pr-review","linter","python"],"created_at":"2024-08-09T13:02:51.469Z","updated_at":"2024-11-29T10:30:50.692Z","avatar_url":"https://github.com/grantmcconnaughey.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Lintly\n\n[![Build Status](https://travis-ci.org/grantmcconnaughey/Lintly.svg?branch=master)](https://travis-ci.org/grantmcconnaughey/Lintly) [![codecov](https://codecov.io/gh/grantmcconnaughey/lintly/branch/master/graph/badge.svg)](https://codecov.io/gh/grantmcconnaughey/lintly)\n\nAutomated GitHub PR code reviewer for Python, JavaScript, CSS, and more.\n\n## Usage\n\nFirst, `pip` install lintly:\n\n    $ pip install lintly\n\n\u003e Lintly requires Python 2.7 or 3.4+.\n\nNext, set the `LINTLY_API_KEY` environment variable to your GitHub API Key:\n\n    $ export LINTLY_API_KEY=\"12345\"\n\nFinally, pipe the output of your linter to the `lintly` script:\n\n    $ flake8 | lintly\n\nNow you will see a review with linting errors...\n\n![Lintly review on a pull request](./example_review.png)\n\n...and a commit check...\n\n![Lintly commit check on a pull request](./example_checks.png)\n\n...on your pull requests! Nifty! 🎉\n\n## Supported Linters\n\n- [flake8](http://flake8.pycqa.org/en/latest/)\n    ```\n    $ flake8 | lintly --format=flake8\n    ```\n- [black](https://black.readthedocs.io/en/stable/)\n    ```\n    $ black . --check 2\u003e\u00261 \u003e/dev/null | lintly --format=black\n    ```\n- [pylint](https://www.pylint.org/)\n    - For pylint you must use the `json` output format.\n    ```\n    $ pylint . --output-format=json | lintly --format=pylint-json\n    ```\n- [eslint](https://eslint.org/)\n    ```\n    $ eslint . | lintly --format=eslint\n    ```\n- [stylelint](https://stylelint.io/)\n    ```\n    $ stylelint . | lintly --format=stylelint\n    ```\n\n- [cfn-lint](https://github.com/aws-cloudformation/cfn-python-lint)\n    ```\n    $ cfn-lint template.yaml | lintly --format=cfn-lint\n    ```\n\n- [cfn-nag](https://github.com/stelligent/cfn_nag)\n    ```\n    $ cfn_nag_scan --input-path cloudformation-template.yaml --output-format=json | lintly --format=cfn-nag\n    ```\n\nAdditional linters can be added by modifying the `lintly/parsers.py` module.\n\n## Configuration\n\nAt a minimum Lintly needs to know the following information to determine how to post the correct GitHub PR Review:\n\n- **GitHub API key** (`--api-key` or `LINTLY_API_KEY` env var)\n    - Generate your own [API Key here](https://github.com/settings/tokens/new). The API key will need the following GitHub scopes:\n        - `repo:status` so that Lintly can post commit statuses on PRs.\n        - `public_repo` so that Lintly can create pull request reviews on public repos.\n        - `repo` so that Lintly can create pull request reviews on private repos.\n- **GitHub repository** (`--repo` or `LINTLY_REPO` env var)\n    - This is your repository in the format `grantmcconnaughey/lintly`.\n    \u003e Note: Most Continuous Integration platforms will provide this value automatically.\n- **Pull Request number** (`--pr` or `LINTLY_PR` env var)\n    \u003e Note: Most Continuous Integration platforms will provide this value automatically.\n\nThese configuration values can be provided to Lintly via environment variables, discovered automatically when run in a supported CI platform,\nor by being passed in as arguments to the Lintly CLI.\n\n### Options\n\nA list of all configuration values can be viewed by running `lintly --help`.\n\n```\nUsage: lintly [OPTIONS]\n\n  Slurp up linter output and send it to a GitHub PR review.\n\nOptions:\n  --api-key TEXT                  The GitHub API key to use for commenting on\n                                  PRs (required)\n  --repo TEXT                     The GitHub repo name in the format\n                                  {owner}/{repo}\n  --pr TEXT                       The pull request number for this build\n                                  (required)\n  --commit-sha TEXT               The commit Lintly is running against\n                                  (required)\n  --format [unix|flake8|pylint-json|eslint|eslint-unix|stylelint|black|cfn-lint|cfn-nag]\n                                  The linting output format Lintly should\n                                  expect to receive. Default \"flake8\"\n  --context TEXT                  Override the commit status context\n  --fail-on [any|new]             Whether Lintly should fail if any violations\n                                  are detected or only if new violations are\n                                  detected. Default \"any\"\n  --post-status / --no-post-status\n                                  Used to determine if Lintly should post a PR\n                                  status to GitHub. Default true\n  --request-changes / --no-request-changes\n                                  Whether Lintly should post violations as a\n                                  PR request for changes instead of a comment\n                                  review. Default true\n  --use-checks / --no-use-checks  Whether Lintly should try to use the GitHub\n                                  Checks API to report on changes requested.\n                                  This only works when running as a GitHub\n                                  App. Default false\n  --log                           Send Lintly debug logs to the console.\n                                  Default false\n  --exit-zero / --no-exit-zero    Whether Lintly should exit with error code\n                                  indicating amount of violations or not.\n                                  Default false\n  --help                          Show this message and exit.\n```\n\n## Supported Continuous Integration platforms\n\nLintly works out of the box with all of the CI platforms supported by [ci.py](https://github.com/grantmcconnaughey/ci.py#ci-services). To add support for new CI platforms create a PR to the ci.py repo.\n\nWhen using these Continuous Integration platforms the repository, pull request number, and commit SHA will be detected automatically.\n\n### GitHub Actions example\n\nTo use Lintly with GitHub Actions, create a file called `.github/workflows/lint.yaml` with the following contents:\n\n```yaml\nname: Lint\n\non: [pull_request]\n\njobs:\n  lint:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v2\n    - name: Set up Python\n      uses: actions/setup-python@v2\n      with:\n        python-version: 3.8\n    - name: Install dependencies\n      run: pip install flake8 lintly\n    - name: Lint with flake8\n      run: flake8 | lintly\n      env:\n        LINTLY_API_KEY: ${{ secrets.GITHUB_TOKEN }}\n```\n\n### Travis CI example\n\nTo use with Lintly with Travis CI, add the following to your `.travis.yml` config file:\n\n```yml\nlanguage: python\n\njobs:\n  include:\n    - stage: lint\n      install: pip install lintly\n      script: flake8 | lintly --format=flake8\n\nstages:\n  - lint\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrantmcconnaughey%2FLintly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrantmcconnaughey%2FLintly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrantmcconnaughey%2FLintly/lists"}