{"id":15691656,"url":"https://github.com/elijahr/lintball","last_synced_at":"2025-04-19T12:55:13.679Z","repository":{"id":42675706,"uuid":"327761145","full_name":"elijahr/lintball","owner":"elijahr","description":"keep your entire project tidy with one command","archived":false,"fork":false,"pushed_at":"2025-03-15T00:34:41.000Z","size":2151,"stargazers_count":8,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"devel","last_synced_at":"2025-03-29T08:04:49.570Z","etag":null,"topics":["autoformat","bash","black","css","eslint","html","linters","prettier","python","yaml"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elijahr.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-08T00:52:26.000Z","updated_at":"2025-03-15T00:34:32.000Z","dependencies_parsed_at":"2024-06-21T14:08:33.474Z","dependency_job_id":"50777d20-ae4f-43d8-9612-449b34be8654","html_url":"https://github.com/elijahr/lintball","commit_stats":{"total_commits":186,"total_committers":6,"mean_commits":31.0,"dds":"0.032258064516129004","last_synced_commit":"b9e93b604a6d2ad20a1e728e73d3a77c71cba7be"},"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elijahr%2Flintball","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elijahr%2Flintball/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elijahr%2Flintball/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elijahr%2Flintball/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elijahr","download_url":"https://codeload.github.com/elijahr/lintball/tar.gz/refs/heads/devel","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249699449,"owners_count":21312400,"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":["autoformat","bash","black","css","eslint","html","linters","prettier","python","yaml"],"created_at":"2024-10-03T18:22:42.951Z","updated_at":"2025-04-19T12:55:13.649Z","avatar_url":"https://github.com/elijahr.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI Workflow](https://github.com/elijahr/lintball/actions/workflows/build.yml/badge.svg)](https://github.com/elijahr/lintball/actions/workflows/build.yml)\n\n```\n█   █ █▄ █ ▀█▀ ██▄ ▄▀▄ █   █\n█▄▄ █ █ ▀█  █  █▄█ █▀█ █▄▄ █▄▄\nkeep your entire project tidy with one command.\n```\n\nlintball is a wrapper script around linters (static code analysis tools) and code formatters (such as prettier, black, etc).\n\n## Why use lintball?\n\nMost software projects consist of more than one programming language. There's source code, documentation, configuration files, build scripts, and so on. Each language may have tools to find and fix issues - but configuring CI, git hooks, etc for each of these tools can be tedious - especially if you work on a lot of projects. The goal of lintball is to streamline the installation and running of these tools so that you have more time for the more fun and important things.\n\n## Supported languages\n\n| Language     | Detection                                |                                        Tools used                                        |\n| :----------- | ---------------------------------------- | :--------------------------------------------------------------------------------------: |\n| bash         | `*.bash`, `#!/usr/bin/env bash`          |                               [shellcheck][1], [shfmt][1]                                |\n| bats         | `*.bats`, `#!/usr/bin/env bats`          |                               [shellcheck][1], [shfmt][2]                                |\n| CSS          | `*.css`                                  |                                      [prettier][4]                                       |\n| Cython       | `*.pyx`, `*.pxd`, `*.pxi`                |                     [autoflake][5], [autopep8][6], [docformatter][7]                     |\n| GraphQL      | `*.graphql`                              |                                      [prettier][4]                                       |\n| HTML         | `*.html`                                 |                                      [prettier][4]                                       |\n| JavaScript   | `*.js`, `*.cjs`, `#!/usr/bin/env node`   |                                [eslint][9],[prettier][4]                                 |\n| JSON         | `*.json`                                 |                                      [prettier][4]                                       |\n| JSX          | `*.jsx`                                  |                                [eslint][9],[prettier][4]                                 |\n| ksh          | `*.ksh`, `#!/usr/bin/env ksh`            |                               [shellcheck][1], [shfmt][2]                                |\n| Markdown     | `*.md`                                   |                                      [prettier][4]                                       |\n| MDX          | `*.mdx`                                  |                                      [prettier][4]                                       |\n| mksh         | `*.mksh`, `#!/usr/bin/env mksh`          |                               [shellcheck][1], [shfmt][2]                                |\n| package.json | `package.json`                           |                               [prettier-package-json][12]                                |\n| pug          | `*.pug`                                  |                                [prettier/plugin-pug][13]                                 |\n| Python       | `*.py`, `*.pyi`, `#!/usr/bin/env python` | [autoflake][5], [autopep8][6], [black][14], [docformatter][7], [isort][15], [pylint][22] |\n| SASS         | `*.scss`                                 |                                      [prettier][4]                                       |\n| sh           | `*.sh`, `#!/bin/sh`                      |                               [shellcheck][1], [shfmt][2]                                |\n| TSX          | `*.tsx`                                  |                                [eslint][9],[prettier][4]                                 |\n| TypeScript   | `*.ts`                                   |                                [eslint][9],[prettier][4]                                 |\n| XML          | `*.xml`                                  |                                [prettier/plugin-xml][19]                                 |\n| YAML         | `*.yml`, `*.yaml`                        |                              [prettier][4], [yamllint][20]                               |\n\n## Installation: upgrading from v1\n\nlintball v1 was installed locally as an npm package and required a lengthy GitHub Actions Workflow.\nlintball v2 introduces dockerization and a GitHub Action.\n\nTo upgrade a lintball v1 project to use lintball v2:\n\n1. Remove existing lint GitHub Actions workflow in `.github/workflows`.\n2. `rm -rf .githooks`\n\nThen follow the below instructions to install lintball v2.\n\n## Installation: git pre-commit hook\n\nlintball runs in a docker container as a git pre-commit hook. To install the hook:\n\n```sh\ndocker run --volume \".:/workspace\" elijahru/lintball lintball install-githooks\n```\n\nThis will run the linters and formatters automatically when you make a git commit.\n\nIf any issues are found which cannot be automatically fixed, the commit will be blocked and an error message will be shown indicating any necessary changes.\n\n## Installation: GitHub Actions\n\nAn example GitHub Actions workflow for linting your project on push:\n\n```yml\n# yamllint disable rule:line-length\n\nname: Lint\n\n# yamllint disable rule:truthy\non:\n  push:\n    branches: [\"*\"]\n    tags: [\"*\"]\n# yamllint enable rule:truthy\n\njobs:\n  lint:\n    name: lint\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v4\n        with:\n          fetch-depth: 0 # This is necessary for linting only recent changes\n      - name: Run lintball\n        uses: elijahr/run-lintball@v2\n```\n\n## Additional Usage\n\nIf you need functionality besides the pre-commit hook, you may run via:\n\n```shell\ndocker run --volume \".:/workspace\" elijahru/lintball \u003clintball command\u003e\n```\n\nWhere \u0026lt;lintball command\u0026gt; is one of:\n\n```\nUsage:\n  lintball [-h | -v]\n  lintball [-c \u003cpath\u003e] check [--since \u003ccommit\u003e] [--jobs \u003cn\u003e] [paths …]\n  lintball [-c \u003cpath\u003e] fix [--since \u003ccommit\u003e] [--jobs \u003cn\u003e] [paths …]\n  lintball [-c \u003cpath\u003e] install-githooks [-y | -n] [-p \u003cpath\u003e]\n  lintball [-c \u003cpath\u003e] install-lintballrc [-y | -n] [-p \u003cpath\u003e]\n  lintball [-c \u003cpath\u003e] install-tools [-y | -n] [-a] [-p \u003cpath\u003e] [ext …]\n  lintball [-c \u003cpath\u003e] pre-commit\n\nOptions:\n  -h, --help                Show this help message \u0026 exit.\n  -v, --version             Print version \u0026 exit.\n  -c, --config \u003cpath\u003e       Use the config file at \u003cpath\u003e.\n\nSubcommands:\n  check [paths …]           Recursively check for issues.\n                              Exit 1 if any issues.\n    -s, --since \u003ccommit\u003e    Check only files changed since \u003ccommit\u003e. This\n                            includes both committed and uncommitted changes.\n                            \u003ccommit\u003e may be a commit hash or a committish, such\n                            as HEAD~1 or master.\n    -j, --jobs \u003cn\u003e          The number of parallel jobs to run.\n                              Default: the number of available CPUs.\n  fix [paths …]             Recursively fix issues.\n                              Exit 1 if unfixable issues.\n    -s, --since \u003ccommit\u003e    Fix only files changed since \u003ccommit\u003e. This\n                            includes both committed and uncommitted changes.\n                            \u003ccommit\u003e may be a commit hash or a committish, such\n                            as HEAD~1 or master.\n    -j, --jobs \u003cn\u003e          The number of parallel jobs to run.\n                              Default: the number of available CPUs.\n  install-githooks          Install lintball githooks in a git repository.\n    -p, --path \u003cpath\u003e       Path to git project to install pre-commit hook to.\n                              Default: working directory.\n    -y, --yes               Skip prompt \u0026 replace repo's githooks.\n    -n, --no                Skip prompt \u0026 exit 1 if repo already has githooks.\n  install-lintballrc        Create a default .lintballrc.json config file.\n    -p, --path \u003cpath\u003e       Where to install the config file.\n                              Default: working directory\n    -y, --yes               Skip prompt \u0026 replace existing .lintballrc.json.\n    -n, --no                Skip prompt \u0026 exit 1 if .lintballrc.json exists.\n  install-tools [ext …]     Install tools for fixing files having extensions\n                            [ext]. If no [ext] are provided, lintball will\n                            autodetect which tools to install based on files in\n                            \u003cpath\u003e.\n    -p, --path \u003cpath\u003e       The path to search for file types.\n                              Default: working directory\n    -y, --yes               Skip prompt \u0026 install missing dependencies.\n    -a, --all               Install *all* tools.\n  pre-commit                Recursively fix issues on files that are fully\n                            staged for commit. Recursively check for issues on\n                            files that are partially staged for commit.\n                              Exit 1 if unfixable issues on fully staged files.\n                              Exit 1 if any issues on partially staged files.\n\nExamples:\n  $ lintball check                       # Check working directory for issues.\n  $ lintball check --since HEAD~1        # Check working directory for issues\n                                         # in all files changes since the commit\n                                         # before last.\n  $ lintball check foo                   # Check the foo directory for issues.\n  $ lintball check foo.py                # Check the foo.py file for issues.\n  $ lintball fix                         # Fix issues in the working directory.\n  $ lintball -c foo/.lintballrc.json fix # Fix issues in the working directory\n                                         # using the specified config.\n  $ lintball fix foo                     # Fix issues in the foo directory.\n  $ lintball fix foo.py                  # Fix issues in the foo.py file.\n  $ lintball install-githooks -p foo     # Install githooks in directory foo.\n  $ lintball install-githooks --yes      # Install a githooks config, replacing\n                                         # any existing githooks config.\n  $ lintball install-lintballrc          # Install a default .lintballrc.json\n                                         # in the working directory.\n  $ lintball install-lintballrc -p foo   # Install default .lintballrc.json in\n                                         # directory foo.\n  $ lintball install-tools               # Autodetect tools for working\n                                         # directory and install them.\n  $ lintball install-tools -p foo        # Autodetect tools for directory foo\n                                         # and install them.\n  $ lintball install-tools --all         # Install all tools.\n  $ lintball install-tools py js yaml    # Install tools for checking Python,\n                                         # JavaScript, \u0026 YAML.\n```\n\n## Configuration\n\n### Ignore patterns\n\nBy default, lintball will not process files matching the following globs:\n\n```sh\n*/.build/*\n*/.bundle/*\n*/.cache/*\n*/.git/*\n*/.hg/*\n*/.next/*\n*/.serverless_nextjs/*\n*/.tmp/*\n*/.tox/*\n*/__pycache__/*\n*/build/*\n*/dist/*\n*/Gemfile.lock\n*/node_modules/*\n*/package-lock.json\n*/Pipfile.lock\n*/target/*\n*/tmp/*\n*/vendor/*\n```\n\nTo add or remove items from this list, run `lintball install-lintballrc` and edit the `ignores` section in the created `.lintballrc.json` file. Ignore patterns are [Full Name Patterns](https://www.gnu.org/software/findutils/manual/html_node/find_html/Full-Name-Patterns.html) passed to the `find` command's `-path` argument. See also: [fnmatch](https://docs.python.org/3/library/fnmatch.html).\n\n### Disabling specific tools\n\nIf you need to disable a tool, create a `.lintballrc.json` file in your project and add a `use` section with only the tools enabled that you wish to use. Note that to disable a tool, explicitly set its value to `false`, otherwise the default value of `true` will take precedence. The default `use` section is defined in [configs/lintballrc-defaults.json][21].\n\n### Tool configuration\n\nMany of the tools used by lintball can be configured to suit your needs. See:\n\n- autopep8: https://pypi.org/project/autopep8/#configuration\n- eslint: https://eslint.org/docs/user-guide/configuring\n- prettier: https://prettier.io/docs/en/configuration.html\n- shellcheck: https://www.mankier.com/1/shellcheck#RC_Files\n\nIf you need to pass custom arguments to a tool (such as specifying a config file), create a `.lintballrc.json` file in your project with custom `write_args` and `check_args`. The default `write_args` and `check_args` are defined in [configs/lintballrc-defaults.json][21].\n\n## Acknowledgements\n\nlintball is a wrapper around existing tools. Many thanks to the authors of the tools used by lintball!\n\n## Contributing\n\nPull requests are welcome! lintball has a suite of unit tests, located in the `test` directory. The tests can be run with `/scripts/run-tests-external.sh`. Please ensure that your features or fixes come with unit tests.\n\n[1]: https://www.shellcheck.net/\n[2]: https://github.com/mvdan/sh\n[4]: https://prettier.io/\n[5]: https://pypi.org/project/autoflake/\n[6]: https://pypi.org/project/autopep8/\n[7]: https://pypi.org/project/docformatter/\n[9]: https://github.com/eslint/eslint\n[12]: https://github.com/cameronhunter/prettier-package-json\n[13]: https://github.com/prettier/plugin-pug\n[14]: https://github.com/psf/black\n[15]: https://pypi.org/project/isort/\n[19]: https://github.com/prettier/plugin-xml\n[20]: https://yamllint.readthedocs.io/en/stable/\n[21]: https://github.com/elijahr/lintball/tree/devel/configs/lintballrc-defaults.json\n[22]: http://pylint.pycqa.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felijahr%2Flintball","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felijahr%2Flintball","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felijahr%2Flintball/lists"}