Skip to content

Commit

Permalink
ci: uninstall pre-commit-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
HRemonen committed Sep 2, 2023
1 parent ed1fe27 commit 4d1cdd2
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 65 deletions.
15 changes: 0 additions & 15 deletions .pre-commit-config.yaml

This file was deleted.

46 changes: 0 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,52 +64,6 @@ To format and organize your import statements, run:
gofumpt -l -w .
```

## Pre-Commit Hooks

This project utilizes pre-commit hooks to ensure code quality and consistency before commits are made. Pre-commit hooks are automated checks that run locally on your development environment before you commit changes to the repository. They help maintain code quality and consistency across the project.

### Available Pre-Commit Hooks

We use the following pre-commit hooks from various repositories to check and format our code:

#### [pre-commit/pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks)

1. **check-added-large-files**: Prevents large files from being added to the repository.
2. **trailing-whitespace**: Ensures there are no trailing whitespace characters at the end of lines.
3. **end-of-file-fixer**: Appends a newline to the end of files if it's missing.
4. **check-yaml**: Checks YAML files for syntax errors.
5. **check-json**: Checks JSON files for syntax errors.

#### [TekWizely/pre-commit-golang](https://github.com/TekWizely/pre-commit-golang)

1. **go-fumpt**: Enforces the gofumpt code style for Go code.
2. **golangci-lint**: Runs linting checks on Go code using golangci-lint.
3. **go-test-mod**: Ensures that your Go code's `go.mod` and `go.sum` files are up-to-date.


### How to Use Pre-Commit Hooks

1. **Install Pre-Commit**: If you haven't already installed pre-commit, you can do so by following the [installation guide](https://pre-commit.com/#install) on the Pre-Commit website.

2. **Install Pre-Commit Hooks Locally**: Run the following command to install the pre-commit hooks locally in your project:

```bash
pre-commit install
```

3. **Run Pre-Commit**: Before committing your changes, run the pre-commit hooks using:

```bash
pre-commit run --all-files
```

This command will run all configured hooks on your changes. If any hooks fail, they will provide feedback on what needs to be fixed.

4. **Commit with Confidence**: Once all hooks pass without errors, you can commit your changes knowing that they meet the code quality and style standards defined in the pre-commit hooks.

**Note for Contributors**: To maintain consistency and adhere to project standards, please do not modify the .pre-commit-config.yaml file. Changes to this file are not to be made if you want to contribute to the project.


## Installation

To install CommitSense, you'll need [Go](https://golang.org/) installed on your system.
Expand Down
3 changes: 1 addition & 2 deletions cmd/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ Copyright © 2023 HENRI REMONEN <henri@remonen.fi>
package cmd

import (
"commitsense/pkg/item"
"fmt"
"os"
"os/exec"
"strings"

"commitsense/pkg/item"

"github.com/manifoldco/promptui"
"github.com/spf13/cobra"
)
Expand Down
3 changes: 1 addition & 2 deletions cmd/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ Copyright © 2023 HENRI REMONEN <henri@remonen.fi>
package cmd

import (
"commitsense/pkg/prompt"
"fmt"
"os"
"os/exec"
"strings"

"commitsense/pkg/prompt"

"github.com/manifoldco/promptui"
"github.com/spf13/cobra"
)
Expand Down

0 comments on commit 4d1cdd2

Please sign in to comment.