Skip to content

Commit

Permalink
[AIRFLOW-5226] Consistent licences for all jinja templates (#5828)
Browse files Browse the repository at this point in the history
(cherry picked from commit afa7180)
  • Loading branch information
potiuk committed Aug 27, 2019
1 parent 72e86e9 commit 3548e7b
Show file tree
Hide file tree
Showing 59 changed files with 888 additions and 903 deletions.
23 changes: 21 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ repos:
name: Check if licences are OK for Apache
entry: ./scripts/ci/ci_check_license.sh
language: system
always_run: true
files: ^\.pre-commit-config\.yaml$
pass_filenames: true
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.6
- repo: https://github.com/potiuk/pre-commit-hooks
rev: d5bee8590ea3405a299825e68dbfa0e1b951a2be
hooks:
- id: forbid-tabs
exclude: ^airflow/_vendor/.*$|^docs/Makefile$
Expand All @@ -48,6 +49,7 @@ repos:
- "/*||*/"
- --license-filepath
- license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
- id: insert-license
name: Add licence for all other files
exclude: ^\.github/.*$"|^airflow/_vendor/.*$
Expand All @@ -56,6 +58,7 @@ repos:
- "|#|"
- --license-filepath
- license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
files: >
\.properties$|\.cfg$|\.conf$|\.ini$|\.ldif$|\.readthedocs$|\.service$|^Dockerfile.*$
- id: insert-license
Expand All @@ -66,6 +69,7 @@ repos:
- "||"
- --license-filepath
- license-templates/LICENSE.rst
- --fuzzy-match-generates-todo
files: \.rst$
- id: insert-license
name: Add licence for all JS files
Expand All @@ -76,6 +80,17 @@ repos:
- "/**| *| */"
- --license-filepath
- license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
- id: insert-license
name: Add licence for all JINJA template files
files: ^airflow/www/templates/.*\.html$|^docs/templates/.*\.html$|^airflow/contrib/plugins/metastore_browser/templates/.*\.html$ # yamllint disable-line rule:line-length
exclude: ^\.github/.*$|^airflow/_vendor/.*$
args:
- --comment-style
- "{#||#}"
- --license-filepath
- license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
- id: insert-license
name: Add licence for shell files
exclude: ^\.github/.*$"|^airflow/_vendor/.*$
Expand All @@ -85,6 +100,7 @@ repos:
- "|#|"
- --license-filepath
- license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
- id: insert-license
name: Add licence for all XML files
exclude: ^\.github/.*$"|^airflow/_vendor/.*$
Expand All @@ -94,6 +110,7 @@ repos:
- "<!--||-->"
- --license-filepath
- license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
- id: insert-license
name: Add licence for yaml files
exclude: ^\.github/.*$"|^airflow/_vendor/.*$
Expand All @@ -103,6 +120,7 @@ repos:
- "|#|"
- --license-filepath
- license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
- id: insert-license
name: Add licence for all md files
files: \.md$
Expand All @@ -112,6 +130,7 @@ repos:
- "<!--|| -->"
- --license-filepath
- license-templates/LICENSE.txt
- --fuzzy-match-generates-todo
- repo: https://github.com/thlorenz/doctoc.git
rev: v1.4.0
hooks:
Expand Down
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,12 @@ jobs:
env: BACKEND=postgres ENV=kubernetes KUBERNETES_VERSION=v1.9.0 KUBERNETES_MODE=git_mode
python: "2.7"
stage: test
- name: "Static checks (no pylint, no licence check)"
- name: "Static checks (no licence check)"
stage: pre-test
script: ./scripts/ci/ci_run_all_static_tests_except_licence.sh
- name: "Check licence compliance for Apache"
stage: pre-test
script: ./scripts/ci/ci_check_license.sh
- name: "Pylint checks"
stage: pre-test
script: ./scripts/ci/ci_run_all_static_tests_pylint.sh
- name: "Build documentation"
stage: pre-test
script: ./scripts/ci/ci_docs.sh
Expand Down
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,6 @@ insert-license Add licences for most file types
lint-dockerfile Lint dockerfile
mixed-line-ending Detects if mixed line ending is used (\r vs. \r\n)
mypy Run mypy
pylint Run pylint
shellcheck Check shell files with shellcheck
yamllint Check yaml files with yamllint
```
Expand All @@ -688,10 +687,10 @@ run pre-commit hooks manually as needed.
`pre-commit run mypy --all-files`

*You can run all checks manually on all files by running:*
`SKIP=pylint pre-commit run --all-files`
`pre-commit run --all-files`

*You can skip one or more of the checks by specifying comma-separated list of checks to skip in SKIP variable:*
`SKIP=pylint,mypy pre-commit run --all-files`
`SKIP=flake8,mypy pre-commit run --all-files`

## Skipping pre-commit hooks

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{#
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
#}

{% extends 'airflow/master.html' %}

{% block body %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{#
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
{#
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
#}

{% extends 'metastore_browser/base.html' %}

{% block plugin_content %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{#
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
{#
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
#}

{% extends 'metastore_browser/base.html' %}

{% block plugin_content %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{#
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
{#
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
#}

{% extends 'metastore_browser/base.html' %}

{% block plugin_content %}
Expand Down
34 changes: 18 additions & 16 deletions airflow/www/templates/admin/master.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
{#
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
#}

{% extends 'admin/base.html' %}
{% block head_css %}
Expand Down
28 changes: 15 additions & 13 deletions airflow/www/templates/airflow/chart.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{#
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
#}

{% extends "airflow/dag.html" %}
{% block title %}Airflow - DAGs{% endblock %}

Expand Down
32 changes: 17 additions & 15 deletions airflow/www/templates/airflow/chart/create.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
{#
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
{#
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
#}

{% extends 'admin/model/create.html' %}
{% block tail %}
{{ super() }}
Expand Down
Loading

0 comments on commit 3548e7b

Please sign in to comment.