Skip to content

Commit e98f7ce

Browse files
committed
Add pre-commit hook defaults
1 parent 687d47c commit e98f7ce

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
# Linter
55
megalinter-reports/
6-
.pre-commit-config.yaml
76

87
# Byte-compiled / optimized / DLL files
98
__pycache__/

.pre-commit-config.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Copyright 2010 New Relic, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# To install, run:
16+
# pip install --upgrade pre-commit
17+
# pre-commit install --install-hooks
18+
#
19+
# To change this file for local use without git picking it up, you can mark it with:
20+
# git update-index --assume-unchanged .pre-commit-config.yaml
21+
#
22+
# To revert that, you can use:
23+
# git update-index --no-assume-unchanged .pre-commit-config.yaml
24+
25+
default_install_hook_types:
26+
- pre-commit
27+
- pre-push
28+
29+
repos:
30+
- repo: https://github.com/astral-sh/ruff-pre-commit
31+
# Ruff version.
32+
rev: v0.11.5
33+
hooks:
34+
# Run the linter.
35+
- id: ruff
36+
args: [ --fix ]
37+
stages: [ pre-push ]
38+
# Run the formatter.
39+
- id: ruff-format
40+
stages: [ pre-push ]
41+
42+
- repo: https://github.com/google/addlicense
43+
rev: 55a521bf81c24480094950caa3566548fa63875e
44+
hooks:
45+
- id: addlicense
46+
args: [ "-f", "./.github/LICENSE_HEADER", "-ignore", "newrelic/packages/**/*" ]
47+
stages: [ pre-push ]

0 commit comments

Comments
 (0)