Skip to content

Commit

Permalink
more docs on pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Dec 26, 2023
1 parent d7e1017 commit 3fe3220
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: documentation

on: workflow_dispatch
# on: [pull_request]


permissions:
contents: write
Expand Down
11 changes: 0 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: []
submodules: false

repos:
- repo: https://github.com/cheshirekow/cmake-format-precommit
Expand Down
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,29 @@ Precommit is a framework for mmangaing and maintain multi-lanagueg pre-commit ho
Precommit is auto applied through CI to every pull request and every commit to the said pull request. Precommit checks for valid yaml files, end of file spaces, Syntax of C codeand etc. To see specifically what formating precommit looks for please check out our .clang-format and .cmake-format filed as well as our .pre-commit-config.yaml which show the specific precommit hooks being applied.

### Running Pre-commit locally
To run pre-commit locally you first must install pre-commit. It can be installed via
To run pre-commit locally you first must install pre-commit and there are a couple ways to do this.

#### Prerequiste to installing pre-commit
It is recommended that you install pre-commit through python. Here we assume Python is aleadly installed if that is not the case please check out these [docs](https://wiki.python.org/moin/BeginnersGuide/Download) for how to install python.

Next create a virtual environment with the following:
```shell
python -m venv /path/to/new/virtual/environment
```

Activate the new environment:
```shell
source /path/to/new/virtual/environment/bin/activate
```

Now that we are within a virtual environment we can install pre-commit via;
```shell
pip install pre-commit
```

To install the hooks and have pre-commit run automatically before every commit run
```shell
pre-commit install
pre-commit install --install-hooks
```

If you want to manually run all pre-commit hooks on a repository, run
Expand Down

0 comments on commit 3fe3220

Please sign in to comment.