Skip to content

UCSolarCarTeam/Solar-Car-Pre-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solar Car Software Team pre-commit hook

Pre-defined pre-commit hooks for the Solar Car software team.

Installation

Ensure that you have installed pre-commit following the instructions here.

To use this pre-commit hook in your repo, add the following to your .pre-commit-config.yaml file.

Also ensure rust is installed by following instructions here for Windows/Linux and here for MacOS.

-   repo: https://github.com/UCSolarCarTeam/Solar-Car-Pre-commit
    rev: # tag e.g. v1.0.0
    hooks:
    -   id: hook-name

Recommended hooks

These are the recommended pre-commit hooks to be used.

-   repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.3.0
    hooks:
    -   id: check-yaml
    -   id: end-of-file-fixer
    -   id: trailing-whitespace
    -   id: mixed-line-ending

Hooks

Commit message validator

To use this commit hook, add the following to your .pre-commit-config.yaml.

    hooks:
    -   id: solar-car-commit-msg
        stages: [commit-msg]

This pre-commit hooks verifies that the commit message follows the solar car commit message guideline. Commit messages must begin with an SFT-XXX tag and be followed by a short description of the commit. Commit messages must be between 20 and 72 characters.

Example commit message Hook result
SFT-1 Commit message ✓ Pass
Commit message ✕ Fail
This commit message is waaaaaayyyyyy tooooooooooooooooo longggggggggggg ✕ Fail

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages