Categorygithub.com/iarkhanhelsky/check_diff
modulepackage
0.2.0
Repository: https://github.com/iarkhanhelsky/check_diff.git
Documentation: pkg.go.dev

# README

check_diff (wip)

Coverage Status

check_diff is a command-line tool targeted to apply static checks on changed files and lines.

Install

go install

go install github.com/iarkhanhelsky/check_diff@latest

manually

Download the pre-compiled binaries from the releases page and copy them to the desired location.

Setup

Local

  1. Create empty check_diff.yaml file in your project root directory.
  2. Specify your linters configuration in check_diff.yaml
  3. Change any of your source files introducing lint errors
  4. Run the following command to check your changes
    $ git diff | check_diff 
    

git hooks

Create simple git hook to check each commit you made: .git/hook/pre-commit

#!/bin/bash
git diff | bin/check_diff

CI

Gitlab

See Gitlab docs for more information

Example step configuration

check-diff:
  stage: test
  script:
    # Find merge base and make a diff. We don't need changes that appeared in
    # upstream after feature branch was created
    - git diff -r $(git merge-base $CI_MERGE_REQUEST_DIFF_BASE_SHA HEAD) | ./bin/check_diff --format gitlab -o .gitlab-lint
  artifacts:
    reports:
      codequality: .gitlab-lint

Builtin linter bindings

LanguageLinterBundled VersionTested With
Gogolangci-lint1.46.0-//-
JavaCheckstyle9.3-//-
K8Skube-linter0.2.5-//-
Rubyrubocop1.25.1

Output formats

  • STDOUT - print lint issues in human-readable format
  • Phabricator
  • Codeclimate

# Packages

No description provided by the author
No description provided by the author