Skip to content

Commit cd3c107

Browse files
authored
SNOW-619729 Add license insert hook to pre-commit
1 parent 45d50da commit cd3c107

30 files changed

+67
-51
lines changed

.pre-commit-config.yaml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
exclude: '^(.*egg.info.*|.*/parameters.py).*$'
22
repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v2.2.3
4+
rev: v4.3.0
55
hooks:
66
- id: trailing-whitespace
77
- id: end-of-file-fixer
88
- id: check-yaml
99
exclude: .github/repo_meta.yaml
1010
- id: debug-statements
11-
- id: flake8
12-
additional_dependencies: ["flake8-bugbear == 19.3.0"]
1311
- repo: https://github.com/PyCQA/isort
1412
rev: 5.10.1
1513
hooks:
@@ -20,9 +18,29 @@ repos:
2018
- id: pyupgrade
2119
args: [--py37-plus]
2220
- repo: https://github.com/psf/black
23-
rev: 22.3.0
21+
rev: 22.6.0
2422
hooks:
2523
- id: black
2624
args:
2725
- --safe
2826
language_version: python3
27+
- repo: https://github.com/Lucas-C/pre-commit-hooks.git
28+
rev: v1.2.0
29+
hooks:
30+
- id: insert-license
31+
name: insert-py-license
32+
files: >
33+
(?x)^(
34+
src/snowflake/sqlalchemy/.*\.py|
35+
tests/.*\.py|
36+
setup.py
37+
)$
38+
args:
39+
- --license-filepath
40+
- license_header.txt
41+
- repo: https://gitlab.com/pycqa/flake8
42+
rev: 3.9.2
43+
hooks:
44+
- id: flake8
45+
additional_dependencies:
46+
- flake8-bugbear == 20.11.1

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
same "printed page" as the copyright notice for easier
188188
identification within third-party archives.
189189

190-
Copyright (c) 2012-2019 Snowflake Computing, Inc.
190+
Copyright (c) 2012-2022 Snowflake Computing, Inc.
191191

192192
Licensed under the Apache License, Version 2.0 (the "License");
193193
you may not use this file except in compliance with the License.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ pip install --upgrade snowflake-sqlalchemy
3636
which connects to Snowflake and displays the Snowflake version:
3737

3838
```python
39-
#!/usr/bin/env python
4039
from sqlalchemy import create_engine
4140

4241
engine = create_engine(

license_header.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
Copyright (c) 2012-2022 Snowflake Computing Inc. All rights reserved.

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#!/usr/bin/env python
1+
#
2+
# Copyright (c) 2012-2022 Snowflake Computing Inc. All rights reserved.
3+
#
24

35
from setuptools import setup
46

src/snowflake/sqlalchemy/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#!/usr/bin/env python
21
#
3-
# Copyright (c) 2012-2019 Snowflake Computing Inc. All right reserved.
2+
# Copyright (c) 2012-2022 Snowflake Computing Inc. All rights reserved.
43
#
54

65
import sys

src/snowflake/sqlalchemy/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#!/usr/bin/env python
21
#
3-
# Copyright (c) 2012-2019 Snowflake Computing Inc. All right reserved.
2+
# Copyright (c) 2012-2022 Snowflake Computing Inc. All rights reserved.
43
#
54

65
import operator

src/snowflake/sqlalchemy/custom_commands.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#!/usr/bin/env python
21
#
3-
# Copyright (c) 2012-2019 Snowflake Computing Inc. All right reserved.
2+
# Copyright (c) 2012-2022 Snowflake Computing Inc. All rights reserved.
43
#
54

65
from collections.abc import Sequence

src/snowflake/sqlalchemy/custom_types.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#!/usr/bin/env python
21
#
3-
# Copyright (c) 2012-2019 Snowflake Computing Inc. All right reserved.
2+
# Copyright (c) 2012-2022 Snowflake Computing Inc. All rights reserved.
43
#
54

65
import sqlalchemy.types as sqltypes

src/snowflake/sqlalchemy/snowdialect.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#!/usr/bin/env python
21
#
3-
# Copyright (c) 2012-2019 Snowflake Computing Inc. All right reserved.
2+
# Copyright (c) 2012-2022 Snowflake Computing Inc. All rights reserved.
43
#
54

65
import operator

0 commit comments

Comments
 (0)