Skip to content

Commit 845d8ab

Browse files
authored
Merge pull request #1651 from mathbunnyru/asalikhov/better_pre_commit
Add some links for pre-commit and add default hooks
2 parents f2294b4 + 0696695 commit 845d8ab

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

.pre-commit-config.yaml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
---
2-
ci:
3-
skip: [hadolint-docker]
4-
2+
# pre-commit is a tool to perform a predefined set of tasks manually and/or
3+
# automatically before git commits are made.
4+
#
5+
# Config reference: https://pre-commit.com/#pre-commit-configyaml---top-level
6+
#
7+
# Common tasks
8+
#
9+
# - Run on all files: pre-commit run --all-files
10+
# - Register git hooks: pre-commit install --install-hooks
11+
#
12+
# See https://pre-commit.com for more information
13+
# See https://pre-commit.com/hooks.html for more hooks
514
repos:
615
# Autoupdate: Python code
716
- repo: https://github.com/asottile/pyupgrade
@@ -40,6 +49,14 @@ repos:
4049
hooks:
4150
- id: prettier
4251

52+
# `pre-commit sample-config` default hooks
53+
- repo: https://github.com/pre-commit/pre-commit-hooks
54+
rev: v4.1.0
55+
hooks:
56+
- id: trailing-whitespace
57+
- id: end-of-file-fixer
58+
- id: check-added-large-files
59+
4360
# Lint: Dockerfile
4461
- repo: https://github.com/hadolint/hadolint.git
4562
rev: v2.8.0
@@ -81,3 +98,8 @@ repos:
8198
hooks:
8299
- id: markdownlint
83100
args: ["--fix"]
101+
102+
# Docker hooks do not work in pre-commit.ci
103+
# See: <https://github.com/pre-commit-ci/issues/issues/11>
104+
ci:
105+
skip: [hadolint-docker]

tensorflow-notebook/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ RUN mamba install --quiet --yes \
1515
mamba clean --all -f -y && \
1616
fix-permissions "${CONDA_DIR}" && \
1717
fix-permissions "/home/${NB_USER}"
18-

0 commit comments

Comments
 (0)