All Projects β†’ grantmcconnaughey β†’ Lintly

grantmcconnaughey / Lintly

Licence: mit
Automated GitHub PR code reviewer for Python, JavaScript, CSS, and more.

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Lintly

Protolint
A pluggable linter and fixer to enforce Protocol Buffer style and conventions.
Stars: ✭ 142 (+56.04%)
Mutual labels:  linter, cli
Linter Farch
Make sure the filenames stay the same, control them! πŸ‘
Stars: ✭ 101 (+10.99%)
Mutual labels:  linter, cli
Eyo
πŸ¦” CLI for restoring the letter Β«Ρ‘Β» (yo) in russian texts
Stars: ✭ 119 (+30.77%)
Mutual labels:  linter, cli
Eslint Watch
ESLint with simple watching capabilities
Stars: ✭ 159 (+74.73%)
Mutual labels:  linter, cli
Reviewdog
🐢 Automated code review tool integrated with any code analysis tools regardless of programming language
Stars: ✭ 4,541 (+4890.11%)
Mutual labels:  linter, cli
Singel
Single Element Pattern
Stars: ✭ 404 (+343.96%)
Mutual labels:  linter, cli
Isort
A Python utility / library to sort imports.
Stars: ✭ 4,377 (+4709.89%)
Mutual labels:  linter, cli
Undercover
Actionable code coverage - detects untested code blocks in recent changes
Stars: ✭ 574 (+530.77%)
Mutual labels:  linter, cli
Forge Node App
πŸ› πŸ“¦πŸŽ‰ Generate Node.js boilerplate with optional libraries & tools
Stars: ✭ 90 (-1.1%)
Mutual labels:  cli
Cookiecutter Fastapi
Cookiecutter template for FastAPI projects using: Machine Learning, Poetry, Azure Pipelines and Pytests
Stars: ✭ 89 (-2.2%)
Mutual labels:  cli
Tj
Create local WordPress dev sites, manage existing sites, and deploy them, all from the command line.
Stars: ✭ 88 (-3.3%)
Mutual labels:  cli
Rymfony
A work-in-progress CLI tool built in Rust to mimic the Symfony CLI binary
Stars: ✭ 89 (-2.2%)
Mutual labels:  cli
Rels
Github release analytics for the console
Stars: ✭ 90 (-1.1%)
Mutual labels:  cli
Rubberduck
Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).
Stars: ✭ 1,287 (+1314.29%)
Mutual labels:  linter
Catj
Displays JSON files in a flat format.
Stars: ✭ 1,301 (+1329.67%)
Mutual labels:  cli
Nps
NPM Package Scripts -- All the benefits of npm scripts without the cost of a bloated package.json and limits of json
Stars: ✭ 1,285 (+1312.09%)
Mutual labels:  cli
Atom Linter Alex
Linter plugin using alex to catch insensitive, inconsiderate writing
Stars: ✭ 87 (-4.4%)
Mutual labels:  linter
Gtts
Python library and CLI tool to interface with Google Translate's text-to-speech API
Stars: ✭ 1,303 (+1331.87%)
Mutual labels:  cli
Run
⚑The resource runtime
Stars: ✭ 90 (-1.1%)
Mutual labels:  cli
Apk File
Search apk package contents via the command line.
Stars: ✭ 89 (-2.2%)
Mutual labels:  cli

Lintly

Build Status codecov

Automated GitHub PR code reviewer for Python, JavaScript, CSS, and more.

Usage

First, pip install lintly:

$ pip install lintly

Lintly requires Python 2.7 or 3.4+.

Next, set the LINTLY_API_KEY environment variable to your GitHub API Key:

$ export LINTLY_API_KEY="12345"

Finally, pipe the output of your linter to the lintly script:

$ flake8 | lintly

Now you will see a review with linting errors...

Lintly review on a pull request

...and a commit check...

Lintly commit check on a pull request

...on your pull requests! Nifty! πŸŽ‰

Supported Linters

  • flake8

    $ flake8 | lintly --format=flake8
    
  • black

    $ black . --check 2>&1 >/dev/null | lintly --format=black
    
  • pylint

    • For pylint you must use the json output format.
    $ pylint . --output-format=json | lintly --format=pylint-json
    
  • eslint

    $ eslint . | lintly --format=eslint
    
  • stylelint

    $ stylelint . | lintly --format=stylelint
    
  • cfn-lint

    $ cfn-lint template.yaml | lintly --format=cfn-lint
    
  • cfn-nag

    $ cfn_nag_scan --input-path cloudformation-template.yaml --output-format=json | lintly --format=cfn-nag
    

Additional linters can be added by modifying the lintly/parsers.py module.

Configuration

At a minimum Lintly needs to know the following information to determine how to post the correct GitHub PR Review:

  • GitHub API key (--api-key or LINTLY_API_KEY env var)
    • Generate your own API Key here. The API key will need the following GitHub scopes:
      • repo:status so that Lintly can post commit statuses on PRs.
      • public_repo so that Lintly can create pull request reviews on public repos.
      • repo so that Lintly can create pull request reviews on private repos.
  • GitHub repository (--repo or LINTLY_REPO env var)
    • This is your repository in the format grantmcconnaughey/lintly.

    Note: Most Continuous Integration platforms will provide this value automatically.

  • Pull Request number (--pr or LINTLY_PR env var)

    Note: Most Continuous Integration platforms will provide this value automatically.

These configuration values can be provided to Lintly via environment variables, discovered automatically when run in a supported CI platform, or by being passed in as arguments to the Lintly CLI.

Options

A list of all configuration values can be viewed by running lintly --help.

Usage: lintly [OPTIONS]

  Slurp up linter output and send it to a GitHub PR review.

Options:
  --api-key TEXT                  The GitHub API key to use for commenting on
                                  PRs (required)
  --repo TEXT                     The GitHub repo name in the format
                                  {owner}/{repo}
  --pr TEXT                       The pull request number for this build
                                  (required)
  --commit-sha TEXT               The commit Lintly is running against
                                  (required)
  --format [unix|flake8|pylint-json|eslint|eslint-unix|stylelint|black|cfn-lint|cfn-nag]
                                  The linting output format Lintly should
                                  expect to receive. Default "flake8"
  --context TEXT                  Override the commit status context
  --fail-on [any|new]             Whether Lintly should fail if any violations
                                  are detected or only if new violations are
                                  detected. Default "any"
  --post-status / --no-post-status
                                  Used to determine if Lintly should post a PR
                                  status to GitHub. Default true
  --request-changes / --no-request-changes
                                  Whether Lintly should post violations as a
                                  PR request for changes instead of a comment
                                  review. Default true
  --use-checks / --no-use-checks  Whether Lintly should try to use the GitHub
                                  Checks API to report on changes requested.
                                  This only works when running as a GitHub
                                  App. Default false
  --log                           Send Lintly debug logs to the console.
                                  Default false
  --exit-zero / --no-exit-zero    Whether Lintly should exit with error code
                                  indicating amount of violations or not.
                                  Default false
  --help                          Show this message and exit.

Supported Continuous Integration platforms

Lintly works out of the box with all of the CI platforms supported by ci.py. To add support for new CI platforms create a PR to the ci.py repo.

When using these Continuous Integration platforms the repository, pull request number, and commit SHA will be detected automatically.

GitHub Actions example

To use Lintly with GitHub Actions, create a file called .github/workflows/lint.yaml with the following contents:

name: Lint

on: [pull_request]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/[email protected]
    - name: Set up Python
      uses: actions/[email protected]
      with:
        python-version: 3.8
    - name: Install dependencies
      run: pip install flake8 lintly
    - name: Lint with flake8
      run: flake8 | lintly
      env:
        LINTLY_API_KEY: ${{ secrets.GITHUB_TOKEN }}

Travis CI example

To use with Lintly with Travis CI, add the following to your .travis.yml config file:

language: python

jobs:
  include:
    - stage: lint
      install: pip install lintly
      script: flake8 | lintly --format=flake8

stages:
  - lint
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].