Skip to content

Commit

Permalink
Adds precommit config
Browse files Browse the repository at this point in the history
Although checkmake is currently broken because of
pre-commit/pre-commit#2722
  • Loading branch information
colindean committed Apr 13, 2023
1 parent 54c540e commit 4cde380
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
repos:
- repo: https://github.com/mrtazz/checkmake.git
rev: 0.2.2
hooks:
- id: checkmake
# OR Use this hook to use a pre-installed checkmark executable
# - id: checkmake-system
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16 # Use the ref you want to point at
hooks:
- id: mdformat
# Optionally add plugins
additional_dependencies:
- mdformat-gfm
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0 # Use the ref you want to point at
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: destroyed-symlinks
- id: end-of-file-fixer
- id: forbid-submodules
4 changes: 4 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
brew 'make' if OS.mac?
brew 'jq'
brew 'curl'
brew 'pre-commit'
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ urls: formula.json
printf "%s" "$${url}" > "$${file}"; \
done

CURL_OPTS = --disable --cookie /dev/null --globoff --show-error --user-agent "homebrew-pkg-size-analysis/0.0.1" --retry 3 --header "Authorization: Bearer QQ==" --fail --location --head
CURL_OPTS = --disable --cookie /dev/null --globoff --show-error --user-agent "homebrew-pkg-size-analysis/0.0.1" --retry 3 --header "Authorization: Bearer QQ==" --fail --location --silent --head

%.response: %.url
curl $(CURL_OPTS) --output $@ "$(shell cat $<)"
Expand All @@ -31,3 +31,7 @@ CURL_OPTS = --disable --cookie /dev/null --globoff --show-error --user-agent "ho

sizes: $(SIZE_FILES)


deps: Brewfile .pre-commit-config.yaml
brew bundle --file=Brewfile --no-lock
pre-commit install

0 comments on commit 4cde380

Please sign in to comment.