Skip to main content

Integrated tool for multi-language linters for command line tooland GitHub action

Project description

https://img.shields.io/pypi/v/glob_linters.svg Documentation Status Build and publish

glob-linters is an integtated tool to lint multiple programming and scripting languages and can be used as a normal command line in terminals as well as a workflow in GtiHub actions.

Features

  • Linting multiple languages.

  • Fully supporting configuration for each linter via configuration files or command options

Supported linters

Language

File extension

Linters

c++

.cpp

cpplint, clang-format

Python

.py

pylint, black, flake8, isort, mypy

Quick start

You can use glob-linters as a command line tool in a terminal or a workflow in GitHub action. Choose the appropriate one as a quick start.

Command line

To use as a command line tool, install the latest package by pip using the following command:

$ pip install glob-linters

After successful installation, you can use glob-linters as a command tool by issuing the following to see the command line options.

$ glob_linters -h

Then run glob_linters to lint all supported languages in the current directory, which will scan all corresponding files recursively and then perform linting. If you want to lint particular files, please visit the documentation for more advanced usages.

GitHub action

To use glob-linters in GitHub action, create a workflow file such as .github/workflows/glob-linters.yml in your own repository with the example contents:

name: Code linting

on:
  push:
    branches: ["main"]
  pull_request:
    branches: ["main"]

jobs:
  glob-linters:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Linting
        uses: bowentan/glob-linters@v0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

You can control the workflow by creating a configuration file named as .github/glob-linters.ini and a sample configuration is given below:

[target]
target_dir = .
target_suffix = .py

[executable]
cpplint = cpplint
clang_format = clang-format
pylint = pylint
flake8 = flake8
black = black
isort = isort

[env]
debug = True

This configuration will enable debug mode with additional information when running and set the directory that will be searched for linting .py files to be the root of your repository.

For more details about usage, please refer to the documentation.

Contributing

If you are interested in this project and would like to make some contributions, please refer to the contributing for the contributing guide.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

# Changelog

## [0.1.0-rc.27](https://github.com/bowentan/glob-linters/compare/v0.1.0-rc.26…v0.1.0-rc.27) (2022-10-13)

### Miscellaneous Chores

## [0.1.0-rc.26](https://github.com/bowentan/glob-linters/compare/v0.1.0-rc.25…v0.1.0-rc.26) (2022-10-13)

### Miscellaneous Chores

## [0.1.0-rc.25](https://github.com/bowentan/glob-linters/compare/v0.1.0-rc.24…v0.1.0-rc.25) (2022-10-13)

### Miscellaneous Chores

## [0.1.0-rc.24](https://github.com/bowentan/glob-linters/compare/v0.1.0-rc.23…v0.1.0-rc.24) (2022-10-13)

### Miscellaneous Chores

## [0.1.0-rc.23](https://github.com/bowentan/glob-linters/compare/v0.1.0-rc.20…v0.1.0-rc.23) (2022-10-13)

### Miscellaneous Chores

## [0.1.0-rc.20](https://github.com/bowentan/glob-linters/compare/v0.1.0-rc.16…v0.1.0-rc.20) (2022-10-13)

### Miscellaneous Chores

## [0.1.0-rc.16](https://github.com/bowentan/glob-linters/compare/v0.1.0-rc.14…v0.1.0-rc.16) (2022-10-13)

### Continuous Integration

### Miscellaneous Chores

## [0.1.0-rc.14](https://github.com/bowentan/glob-linters/compare/v0.1.0-rc.13…v0.1.0-rc.14) (2022-10-13)

### Documentation

### Miscellaneous Chores

### Continuous Integration

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

glob-linters-0.1.0rc27.tar.gz (46.2 kB view details)

Uploaded Source

Built Distribution

glob_linters-0.1.0rc27-py2.py3-none-any.whl (11.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file glob-linters-0.1.0rc27.tar.gz.

File metadata

  • Download URL: glob-linters-0.1.0rc27.tar.gz
  • Upload date:
  • Size: 46.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for glob-linters-0.1.0rc27.tar.gz
Algorithm Hash digest
SHA256 b66c40df55af50b8ace451b9079862fcbb6154c387a8ceb9366c5cbf612a3c76
MD5 7392664cf233f77faa285e8c19133d32
BLAKE2b-256 156065b2101d51ac9afd066be67c9231ac3bc8832cb1a1930beaf0fa944e6607

See more details on using hashes here.

Provenance

File details

Details for the file glob_linters-0.1.0rc27-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for glob_linters-0.1.0rc27-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 bc6091bdcd0dd7913e9d3e032827513d93f75cc9e6de9703ea67251b3b997e86
MD5 23d5989dd321c94554f0cd84e4930584
BLAKE2b-256 4139ac6dce576779f8e46d89a7fd71efba12054c6c94175b48f8691606e0dd81

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page