Skip to content

Commit 5cfe9c2

Browse files
authored
[AIRFLOW-5233] Fixed consistency in whitespace (tabs/eols) + common problems (apache#5835)
* [AIRFLOW-5233] Fixed consistency in whitespace (tabs/eols) + common problems
1 parent e2d76b9 commit 5cfe9c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+485
-503
lines changed

.pre-commit-config.yaml

+12-6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ repos:
2020
- repo: https://github.com/Lucas-C/pre-commit-hooks
2121
rev: v1.1.6
2222
hooks:
23+
- id: forbid-tabs
24+
exclude: ^airflow/_vendor/.*$|^docs/Makefile$
2325
- id: insert-license
2426
name: Add licence for all SQL files
2527
files: \.sql$
@@ -39,12 +41,6 @@ repos:
3941
- license-templates/LICENSE.txt
4042
files: >
4143
\.properties$|\.cfg$|\.conf$|\.ini$|\.ldif$|\.readthedocs$|\.service$|^Dockerfile.*$
42-
- repo: meta
43-
hooks:
44-
- id: check-hooks-apply
45-
- repo: https://github.com/Lucas-C/pre-commit-hooks
46-
rev: v1.1.6
47-
hooks:
4844
- id: insert-license
4945
name: Add licence for all JS files
5046
files: \.js$
@@ -54,6 +50,16 @@ repos:
5450
- "/**| *| */"
5551
- --license-filepath
5652
- license-templates/LICENSE.txt
53+
- repo: meta
54+
hooks:
55+
- id: check-hooks-apply
56+
- repo: https://github.com/pre-commit/pre-commit-hooks
57+
rev: v2.3.0
58+
hooks:
59+
- id: check-merge-conflict
60+
- id: detect-private-key
61+
- id: end-of-file-fixer
62+
- id: mixed-line-ending
5763
- repo: local
5864
hooks:
5965
- id: lint-dockerfile

CONTRIBUTING.md

+5
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,11 @@ lint-dockerfile Lint dockerfile
701701
mypy Run mypy
702702
pylint Run pylint
703703
flake8 Run flake8
704+
forbid-tabs Fails if tabs are used in the project
705+
check-merge-conflict Checks if merge conflict is being committed
706+
detect-private-key Detects if private key is added to the repository
707+
end-of-file-fixer Make sure that there is an empty line at the end
708+
mixed-line-ending Detects if mixed line ending is used (\r vs. \r\n)
704709
```
705710
## Using pre-commit hooks
706711

LICENSE

-1
Original file line numberDiff line numberDiff line change
@@ -262,4 +262,3 @@ The text of each license is also included at licenses/LICENSE-[project].txt.
262262
(BSD 3 License) d3js v3.5.17 (https://d3js.org)
263263
(BSD 3 License) parallel-coordinates v0.7.0 (http://syntagmatic.github.com/parallel-coordinates/)
264264
(BSD 3 License) scikit-learn v0.19.1 (https://github.com/scikit-learn/scikit-learn)
265-

NOTICE

-2
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,3 @@ python-nvd3:
2727
------------
2828

2929
* Copyright (c) 2013 Arezqui Belaid <[email protected]> and other contributors
30-
31-

airflow/_vendor/nvd3/templates/cumulativelinechart.html

-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@
88
{{super()}}
99

1010
{% endblock body %}
11-

airflow/_vendor/nvd3/templates/linechart.html

-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,3 @@
4444
{% endblock close %}
4545

4646
{% endblock body %}
47-

airflow/_vendor/nvd3/templates/lineplusbarchart.html

-1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,3 @@
4141
{% endblock close %}
4242

4343
{% endblock body %}
44-

airflow/config_templates/default_webserver_config.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@
1616
# KIND, either express or implied. See the License for the
1717
# specific language governing permissions and limitations
1818
# under the License.
19-
19+
"""Default configuration for the Airflow webserver"""
2020
import os
21-
from airflow import configuration as conf
2221
from flask_appbuilder.security.manager import AUTH_DB
2322
# from flask_appbuilder.security.manager import AUTH_LDAP
2423
# from flask_appbuilder.security.manager import AUTH_OAUTH
2524
# from flask_appbuilder.security.manager import AUTH_OID
2625
# from flask_appbuilder.security.manager import AUTH_REMOTE_USER
26+
27+
from airflow import configuration as conf
28+
2729
basedir = os.path.abspath(os.path.dirname(__file__))
2830

2931
# The SQLAlchemy connection string.
@@ -62,7 +64,7 @@
6264
# When using OAuth Auth, uncomment to setup provider(s) info
6365
# Google OAuth example:
6466
# OAUTH_PROVIDERS = [{
65-
# 'name':'google',
67+
# 'name':'google',
6668
# 'whitelist': ['@YOU_COMPANY_DOMAIN'], # optional
6769
# 'token_key':'access_token',
6870
# 'icon':'fa-google',

airflow/www/templates/airflow/circles.html

-1
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,3 @@ <h1>Airflow 404 = lots of circles</h1>
141141
toggle();
142142

143143
</script>
144-

airflow/www/templates/airflow/task_instance.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
# to you under the Apache License, Version 2.0 (the
88
# "License"); you may not use this file except in compliance
99
# with the License. You may obtain a copy of the License at
10-
#
10+
#
1111
# http://www.apache.org/licenses/LICENSE-2.0
12-
#
12+
#
1313
# Unless required by applicable law or agreed to in writing,
1414
# software distributed under the License is distributed on an
1515
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -37,7 +37,7 @@ <h4>
3737
{{ task_id }}
3838
<input type="hidden" value="{{ dag.dag_id }}" name="dag_id">
3939
</span>
40-
{{ form.execution_date(class_="form-control") | safe }}
40+
{{ form.execution_date(class_="form-control") | safe }}
4141

4242
</div>
4343
</form>

airflow/www/templates/airflow/version.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
# to you under the Apache License, Version 2.0 (the
88
# "License"); you may not use this file except in compliance
99
# with the License. You may obtain a copy of the License at
10-
#
10+
#
1111
# http://www.apache.org/licenses/LICENSE-2.0
12-
#
12+
#
1313
# Unless required by applicable law or agreed to in writing,
1414
# software distributed under the License is distributed on an
1515
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -23,13 +23,13 @@
2323
{% block content %}
2424
{{ super() }}
2525
<h2>{{ title }}</h2>
26-
{% set version_label = 'Version' %}
26+
{% set version_label = 'Version' %}
2727
{% if airflow_version %}
2828
<h4>{{ version_label }} : <a href="https://pypi.python.org/pypi/apache-airflow/{{ airflow_version }}">{{ airflow_version }}</a></h4>
2929
{% else %}
3030
<h4>{{ version_label }} : Not Available</h4>
3131
{% endif %}
32-
<h4>Git Version :{% if git_version %} {{ git_version }} {% else %} Not Available {% endif %}</h4>
32+
<h4>Git Version :{% if git_version %} {{ git_version }} {% else %} Not Available {% endif %}</h4>
3333
<hr>
3434

3535
{% endblock %}

airflow/www/templates/appbuilder/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
limitations under the License.
1616

1717
#}
18-
{% extends "airflow/dag.html" %}
18+
{% extends "airflow/dag.html" %}

airflow/www/templates/appbuilder/navbar_menu.html

-1
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,3 @@
5454
{% endif %}
5555
{% endif %}
5656
{% endfor %}
57-

airflow/www/templates/appbuilder/navbar_right.html

-1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,3 @@
6161
<li><a href="{{appbuilder.get_url_for_login}}">
6262
<i class="fa fa-fw fa-sign-in"></i>{{_("Login")}}</a></li>
6363
{% endif %}
64-

dev/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ Users can configure this automatically by running `airflow-pr setup_git_remotes`
8686

8787
```bash
8888
$ git remote -v
89-
github https://github.com/apache/airflow.git (fetch)
90-
github https://github.com/apache/airflow.git (push)
91-
origin https://github.com/<USER>/airflow (fetch)
92-
origin https://github.com/<USER>/airflow (push)
89+
github https://github.com/apache/airflow.git (fetch)
90+
github https://github.com/apache/airflow.git (push)
91+
origin https://github.com/<USER>/airflow (fetch)
92+
origin https://github.com/<USER>/airflow (push)
9393
```
9494

9595
#### JIRA

dev/requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ click>=6.6,<7
22
jira>=1.0.7,<2
33
keyring==10.1
44
gitpython
5-

docs/howto/check-health.rst

-1
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,3 @@ To check the health status of your Airflow instance, you can simply access the e
4646

4747
Please keep in mind that the HTTP response code of ``/health`` endpoint **should not** be used to determine the health
4848
status of the application. The return code is only indicative of the state of the rest call (200 for success).
49-

docs/howto/connection/grpc.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ Scopes (comma separated) (Optional)
7070
A list of comma-separated `Google Cloud scopes
7171
<https://developers.google.com/identity/protocols/googlescopes>`_ to
7272
authenticate with.
73-
Only for `OATH_GOOGLE` type connection
73+
Only for `OATH_GOOGLE` type connection

docs/howto/define_extra_link.rst

-1
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,3 @@ The following code shows how to add extra links to an operator:
5454
You can also add a global operator extra link that will be available to
5555
all the operators through airflow plugin. Learn more about it in the
5656
:ref:`plugin example <plugin-example>`.
57-

docs/howto/operator/index.rst

-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,3 @@ information.
3333
gcp/index
3434
papermill
3535
python
36-

0 commit comments

Comments
 (0)