{"id":13590652,"url":"https://github.com/mrtazz/checkmake","last_synced_at":"2025-05-14T14:09:38.279Z","repository":{"id":10778861,"uuid":"66408063","full_name":"mrtazz/checkmake","owner":"mrtazz","description":"experimental linter/analyzer for Makefiles","archived":false,"fork":false,"pushed_at":"2025-05-09T15:45:37.000Z","size":350,"stargazers_count":1076,"open_issues_count":36,"forks_count":45,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-13T07:15:12.061Z","etag":null,"topics":["lint","linter","make","makefile"],"latest_commit_sha":null,"homepage":"","language":"Go","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/mrtazz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2016-08-23T22:27:59.000Z","updated_at":"2025-05-12T22:16:55.000Z","dependencies_parsed_at":"2024-04-12T17:41:08.297Z","dependency_job_id":"31af47c3-3892-4102-922f-b4e45c7841df","html_url":"https://github.com/mrtazz/checkmake","commit_stats":{"total_commits":143,"total_committers":17,"mean_commits":8.411764705882353,"dds":0.3076923076923077,"last_synced_commit":"c047d51fe0a08be186dc0c734151793924ebb249"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrtazz%2Fcheckmake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrtazz%2Fcheckmake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrtazz%2Fcheckmake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrtazz%2Fcheckmake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrtazz","download_url":"https://codeload.github.com/mrtazz/checkmake/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253891796,"owners_count":21979858,"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":["lint","linter","make","makefile"],"created_at":"2024-08-01T16:00:49.199Z","updated_at":"2025-05-14T14:09:33.263Z","avatar_url":"https://github.com/mrtazz.png","language":"Go","readme":"# checkmake\n\n[![Build Status](https://github.com/mrtazz/checkmake/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/mrtazz/checkmake/actions)\n[![Coverage Status](https://coveralls.io/repos/github/mrtazz/checkmake/badge.svg?branch=master)](https://coveralls.io/github/mrtazz/checkmake?branch=master)\n[![Code Climate](https://codeclimate.com/github/mrtazz/checkmake/badges/gpa.svg)](https://codeclimate.com/github/mrtazz/checkmake)\n[![Packagecloud](https://img.shields.io/badge/packagecloud-available-brightgreen.svg)](https://packagecloud.io/mrtazz/checkmake)\n[![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)\n\n## Overview\ncheckmake is an experimental tool for linting and checking Makefiles. It may\nnot do what you want it to.\n\n## Usage\n\n```\n% checkmake Makefile\n\n% checkmake Makefile foo.mk bar.mk baz.mk\n\n% checkmake --help\ncheckmake.\n\nUsage:\ncheckmake [--debug|--config=\u003cconfigPath\u003e] \u003cmakefile\u003e...\ncheckmake -h | --help\ncheckmake --version\n\nOptions:\n-h --help               Show this screen.\n--version               Show version.\n--debug                 Enable debug mode\n--config=\u003cconfigPath\u003e   Configuration file to read\n--list-rules            List registered rules\n\n% checkmake fixtures/missing_phony.make\n\n      RULE                 DESCRIPTION             LINE NUMBER\n\n  minphony        Missing required phony target    0\n                  \"all\"\n  minphony        Missing required phony target    0\n                  \"test\"\n  phonydeclared   Target \"all\" should be           18\n                  declared PHONY.\n\n```\n\n## Docker usage\nBuild the image, or pull it:\n```sh\ndocker build --build-arg BUILDER_NAME='Your Name' --build-arg BUILDER_EMAIL=your.name@example.com . -t checker\n```\n\nThen run it with your Makefile attached, below is an example of it assuming the Makefile is in your current working directory:\n```sh\ndocker run -v \"$PWD\"/Makefile:/Makefile checker\n```\n\n## `pre-commit` usage\n\nThis repo includes a `pre-commit` hook, which you may choose to use in your own\nrepos. Simply add a `.pre-commit-config.yaml` to your repo's top-level directory\n\n```yaml\nrepos:\n-   repo: https://github.com/mrtazz/checkmake.git\n    # Or another commit hash or version\n    rev: 0.2.2\n    hooks:\n    # Use this hook to let pre-commit build checkmake in its sandbox\n    -   id: checkmake\n    # OR Use this hook to use a pre-installed checkmark executable\n    # -   id: checkmake-system\n```\n\nThere are two hooks available:\n\n- `checkmake` (Recommended)\n\n   pre-commit will set up a Go environment from scratch to compile and run checkmake.\n   See the [pre-commit `golang` plugin docs](https://pre-commit.com/#golang) for more information.\n\n- `checkmake-system`\n\n   pre-commit will look for `checkmake` on your `PATH`.\n   This hook requires you to install `checkmake` separately, e.g. with your package manager or [a prebuilt binary release](https://github.com/mrtazz/checkmake/releases).\n   Only recommended if it's permissible to require all repository users install `checkmake` manually.\n\nThen, run `pre-commit` as usual as a part of `git commit` or explicitly, for example:\n\n```sh\npre-commit run --all-files\n```\n\n### pre-commit in GitHub Actions\n\nYou may also choose to run this as a GitHub Actions workflow. To do this, add a\n`.github/workflows/pre-commit.yml` workflow to your repo:\n\n```yaml\nname: pre-commit\n\non:\n  pull_request:\n    branches:\n      - master\n      - main\n    paths:\n      - '.pre-commit-config.yaml'\n      - '.pre-commit-hooks.yaml'\n      - 'Makefile'\n      - 'makefile'\n      - 'GNUmakefile'\n      - '**.mk'\n      - '**.make'\n  push:\n    paths:\n      - '.pre-commit-config.yaml'\n      - '.pre-commit-hooks.yaml'\n      - 'Makefile'\n      - 'makefile'\n      - 'GNUmakefile'\n      - '**.mk'\n      - '**.make'\n\njobs:\n  pre-commit:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v3\n    - uses: actions/setup-python@v3\n    - name: Set up Go 1.17\n      uses: actions/setup-go@v2\n      with:\n        go-version: 1.17\n      id: go\n    - uses: pre-commit/action@v2.0.3\n```\n\n## Installation\n\n### Requirements\nThe [pandoc](https://pandoc.org/) document converter utility is required to run checkmate. You can find out if you have it via `which pandoc`. [Install pandoc](https://pandoc.org/installing.html) if the command was not found.\n\n## With Go\n\nWith `go` 1.16 or higher:\n\n```sh\ngo install github.com/mrtazz/checkmake/cmd/checkmake@latest\ncheckmake Makefile\n```\n\nOr alternatively, run it directly:\n\n```sh\ngo run github.com/mrtazz/checkmake/cmd/checkmake@latest Makefile\n```\n\n### Packages\nThere are packages for linux up [on packagecloud.io](https://packagecloud.io/mrtazz/checkmake) or build it yourself with the steps below.\n\n### Build\nTo build checkmake you will need to have [golang](https://golang.org/) installed. Once you have Go installed, you can simply clone the repo and build the binary and man page yourself with the following commands.\n\n```sh\ngit clone https://github.com/mrtazz/checkmake\ncd checkmake\nmake\n```\n\n## Use in CI\n\n### MegaLinter\n\ncheckmake is [natively embedded](https://oxsecurity.github.io/megalinter/latest/descriptors/makefile_checkmake/) within [MegaLinter](https://github.com/oxsecurity/megalinter)\n\nTo install it, run `npx mega-linter-runner --install` (requires Node.js)\n\n## Inspiration\nThis is totally inspired by an idea by [Dan\nBuch](https://twitter.com/meatballhat/status/768112351924985856).\n","funding_links":[],"categories":["Go","Lint and Highlight","Other"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrtazz%2Fcheckmake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrtazz%2Fcheckmake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrtazz%2Fcheckmake/lists"}