Giter VIP home page Giter VIP logo

gnitpick's People

Contributors

frimro avatar ottok avatar sjaks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

fauust

gnitpick's Issues

Warn if git is not installed

If Gnitpick runs on a system that does not have git installed, there will be an ugly Python error and trace. Implement proper check for binary git and error with a good error message telling users to apt install git etc.

Make script configurable

Currently the requirement to have @seravo in author email is hard-coded, which naturally will not work for many people :)

This should be an option via argparse (see #1) or something that can be configured in a .gnitpick config file.

Extend tests

Currently Gnitpick does not complain anything about a commit like:

 Gnitpick inspecting git revisions range origin/master..HEAD
  commit 59705a9aa1ce99b5cfc7c1617f1f10bed29d9934
  Author: HACKING-STATION\gunhaxxor <[email protected]>
  Date:   Tue Apr 21 12:19:02 2020 +0200
  
      Fixed issue #131
 Inspecting commit 59705a9aa1ce99b5cfc7c1617f1f10bed29d9934:
 Gnitpick commit inspection passed!

Ideally it would check that author name looks like a real name.

Also it would be cool to detect past tense from the git title and enforce imperative form.

Create a shareable github action

An user should be able to run gnitpick on their own repo via github actions. This should be as easy as possible and the default parameters should be generic and not too strict.

We should first try this out with Seravo's own projects and later maybe even publish the action.

Add test suite

Gnitpick has enough features now that there is a risk for regressions. A test suite should be written.

Print more informative errors

If users make a mistake, the error message should be move verbose and have a link to some git documentation so users can read more about best practices.

Add argparse to script

This makes it easier to invoke on the command line and have some parameters sent to the command, instead of having it read environment variables etc.

Compare to Commitzen

The Commitzen project helps enforce git commit messages with a special focus on enforcing developers to adhere to the Angular type of commit practices, where each commit is prefixed with a commit category name. Personally I dislike this practice and think commit subjects should not have a category enforced not should changelogs be automatically exported from commit logs (I think changelogs should be human curated text conveying a message to other humans, not just a plain list).

It might however have some nice features, so we should compare their features at https://commitizen-tools.github.io/commitizen/customization/

Gnitpick fails with dependabot commits

We had a problem where dependabot makes a commit automatically for dependency update. The commit failed gnitpick tests with the following:

Author name 'dependabot[bot]' does not start with an uppercase letter

It would be nice to have a whitelist of common bots or something other logic like if "bot" in name => ok. Please consider the pros and cons of different solutions.

Detect dirty git history that is difficult to bisect etc

Related to the current "merge request should not include merges itself", merges themselves inside to be merged new branch are not necessarily bad, but what specifically is bad, is "diamond" structures where there is "parallel" history that is difficult to bisect.

Idea from discussion with @ericherman

Prevent WIP commits from landing on the master branch

Work-in-progress commits are a good practice for temporary commits during development, but WIP commits should never land on the master branch. Some CI systems (e.g. Gitlab) prevent automatically merges of WIP commits, but it would be good if also Gnitpick prevented those (e.g. to support Gihub users).

--target-branch argument not handled correctly causing an error

sami@pad:~/.../seravo-plugin (master) $ gnitpick --target-branch dev-sami
Traceback (most recent call last):
  File "/usr/bin/gnitpick", line 321, in <module>
    git_rev = f'{target_repository}/{target_branch}..HEAD'
NameError: name 'target_branch' is not defined

If user defines a target_branch with --target_branch, gnitpick will not execute correctly since the correct value cannot be accessed properly. If no target branch is given, gnitpick defaults to master and the program runs correctly.

Using the value of target_branch attribute is since impossible, for instance in #20.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.