diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6ee8925bb4f0f..6df21fe604fbb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,6 +20,8 @@ repos: - repo: https://github.com/Lucas-C/pre-commit-hooks rev: v1.1.6 hooks: + - id: forbid-tabs + exclude: ^airflow/_vendor/.*$|^docs/Makefile$ - id: insert-license name: Add licence for all SQL files files: \.sql$ @@ -51,6 +53,13 @@ repos: - repo: meta hooks: - id: check-hooks-apply + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-merge-conflict + - id: detect-private-key + - id: end-of-file-fixer + - id: mixed-line-ending - repo: local hooks: - id: lint-dockerfile diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index becfca96e5c6a..f6bca0513bca7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -656,6 +656,11 @@ lint-dockerfile Lint dockerfile mypy Run mypy pylint Run pylint flake8 Run flake8 +forbid-tabs Fails if tabs are used in the project +check-merge-conflict Checks if merge conflict is being committed +detect-private-key Detects if private key is added to the repository +end-of-file-fixer Make sure that there is an empty line at the end +mixed-line-ending Detects if mixed line ending is used (\r vs. \r\n) ``` ## Using pre-commit hooks diff --git a/LICENSE b/LICENSE index e3335acb8014a..0bcb76c36a6c9 100644 --- a/LICENSE +++ b/LICENSE @@ -262,4 +262,3 @@ The text of each license is also included at licenses/LICENSE-[project].txt. (BSD 3 License) d3js v3.5.17 (https://d3js.org) (BSD 3 License) parallel-coordinates v0.7.0 (http://syntagmatic.github.com/parallel-coordinates/) (BSD 3 License) scikit-learn v0.19.1 (https://github.com/scikit-learn/scikit-learn) - diff --git a/NOTICE b/NOTICE index 2e6202e30e809..cfa8cb00939e6 100644 --- a/NOTICE +++ b/NOTICE @@ -34,5 +34,3 @@ python-nvd3: ------------ * Copyright (c) 2013 Arezqui Belaid and other contributors - - diff --git a/airflow/_vendor/nvd3/templates/cumulativelinechart.html b/airflow/_vendor/nvd3/templates/cumulativelinechart.html index 546a3e8e55171..66b6c74d1e144 100644 --- a/airflow/_vendor/nvd3/templates/cumulativelinechart.html +++ b/airflow/_vendor/nvd3/templates/cumulativelinechart.html @@ -8,4 +8,3 @@ {{super()}} {% endblock body %} - diff --git a/airflow/_vendor/nvd3/templates/linechart.html b/airflow/_vendor/nvd3/templates/linechart.html index cf15d33041558..edd9633314296 100644 --- a/airflow/_vendor/nvd3/templates/linechart.html +++ b/airflow/_vendor/nvd3/templates/linechart.html @@ -44,4 +44,3 @@ {% endblock close %} {% endblock body %} - diff --git a/airflow/_vendor/nvd3/templates/lineplusbarchart.html b/airflow/_vendor/nvd3/templates/lineplusbarchart.html index 73aeceacd2419..830a192e69afb 100644 --- a/airflow/_vendor/nvd3/templates/lineplusbarchart.html +++ b/airflow/_vendor/nvd3/templates/lineplusbarchart.html @@ -41,4 +41,3 @@ {% endblock close %} {% endblock body %} - diff --git a/airflow/config_templates/default_webserver_config.py b/airflow/config_templates/default_webserver_config.py index e61c7e1a45cb2..ca5fe147eb4ec 100644 --- a/airflow/config_templates/default_webserver_config.py +++ b/airflow/config_templates/default_webserver_config.py @@ -16,14 +16,16 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. - +"""Default configuration for the Airflow webserver""" import os -from airflow import configuration as conf from flask_appbuilder.security.manager import AUTH_DB # from flask_appbuilder.security.manager import AUTH_LDAP # from flask_appbuilder.security.manager import AUTH_OAUTH # from flask_appbuilder.security.manager import AUTH_OID # from flask_appbuilder.security.manager import AUTH_REMOTE_USER + +from airflow import configuration as conf + basedir = os.path.abspath(os.path.dirname(__file__)) # The SQLAlchemy connection string. @@ -62,7 +64,7 @@ # When using OAuth Auth, uncomment to setup provider(s) info # Google OAuth example: # OAUTH_PROVIDERS = [{ -# 'name':'google', +# 'name':'google', # 'whitelist': ['@YOU_COMPANY_DOMAIN'], # optional # 'token_key':'access_token', # 'icon':'fa-google', diff --git a/airflow/www/templates/airflow/circles.html b/airflow/www/templates/airflow/circles.html index 027b4ff4e464e..64eb9303c74ab 100644 --- a/airflow/www/templates/airflow/circles.html +++ b/airflow/www/templates/airflow/circles.html @@ -141,4 +141,3 @@

Airflow 404 = lots of circles

toggle(); - diff --git a/airflow/www/templates/airflow/task_instance.html b/airflow/www/templates/airflow/task_instance.html index f505e5afaac51..924411e72199e 100644 --- a/airflow/www/templates/airflow/task_instance.html +++ b/airflow/www/templates/airflow/task_instance.html @@ -7,9 +7,9 @@ # 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 @@ -36,7 +36,7 @@

{{ task_id }} - {{ form.execution_date(class_="form-control") | safe }} + {{ form.execution_date(class_="form-control") | safe }} diff --git a/airflow/www/templates/airflow/version.html b/airflow/www/templates/airflow/version.html index b8d9777ac7c5f..f0b59f91cefff 100644 --- a/airflow/www/templates/airflow/version.html +++ b/airflow/www/templates/airflow/version.html @@ -7,9 +7,9 @@ # 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 @@ -23,13 +23,13 @@ {% block body %} {{ super() }}

{{ title }}

- {% set version_label = 'Version' %} + {% set version_label = 'Version' %} {% if airflow_version %}

{{ version_label }} : {{ airflow_version }}

{% else %}

{{ version_label }} : Not Available

{% endif %} -

Git Version :{% if git_version %} {{ git_version }} {% else %} Not Available {% endif %}

+

Git Version :{% if git_version %} {{ git_version }} {% else %} Not Available {% endif %}


{% endblock %} diff --git a/airflow/www_rbac/templates/appbuilder/index.html b/airflow/www_rbac/templates/appbuilder/index.html index 0384d5f7d9981..d7170f4ff586d 100644 --- a/airflow/www_rbac/templates/appbuilder/index.html +++ b/airflow/www_rbac/templates/appbuilder/index.html @@ -15,4 +15,4 @@ limitations under the License. #} -{% extends "airflow/dag.html" %} \ No newline at end of file +{% extends "airflow/dag.html" %} diff --git a/airflow/www_rbac/templates/appbuilder/navbar_menu.html b/airflow/www_rbac/templates/appbuilder/navbar_menu.html index 9cf3f94f4094e..6b75074558779 100644 --- a/airflow/www_rbac/templates/appbuilder/navbar_menu.html +++ b/airflow/www_rbac/templates/appbuilder/navbar_menu.html @@ -54,4 +54,3 @@ {% endif %} {% endif %} {% endfor %} - diff --git a/airflow/www_rbac/templates/appbuilder/navbar_right.html b/airflow/www_rbac/templates/appbuilder/navbar_right.html index d42f8e2e8a82c..beff3a8ac9f75 100644 --- a/airflow/www_rbac/templates/appbuilder/navbar_right.html +++ b/airflow/www_rbac/templates/appbuilder/navbar_right.html @@ -61,4 +61,3 @@
  • {{_("Login")}}
  • {% endif %} - diff --git a/dev/README.md b/dev/README.md index a7747526cf862..2866bf17959bb 100755 --- a/dev/README.md +++ b/dev/README.md @@ -82,10 +82,10 @@ Users can configure this automatically by running `airflow-pr setup_git_remotes` ```bash $ git remote -v -github https://github.com/apache/airflow.git (fetch) -github https://github.com/apache/airflow.git (push) -origin https://github.com//airflow (fetch) -origin https://github.com//airflow (push) +github https://github.com/apache/airflow.git (fetch) +github https://github.com/apache/airflow.git (push) +origin https://github.com//airflow (fetch) +origin https://github.com//airflow (push) ``` #### JIRA diff --git a/dev/requirements.txt b/dev/requirements.txt index 2d47d9ea98b5d..3d4ef03a155ca 100644 --- a/dev/requirements.txt +++ b/dev/requirements.txt @@ -2,4 +2,3 @@ click>=6.6,<7 jira>=1.0.7,<2 keyring==10.1 gitpython - diff --git a/docs/howto/check-health.rst b/docs/howto/check-health.rst index ca0e63d8f4dc0..47e07ef4e19cd 100644 --- a/docs/howto/check-health.rst +++ b/docs/howto/check-health.rst @@ -46,4 +46,3 @@ To check the health status of your Airflow instance, you can simply access the e Please keep in mind that the HTTP response code of ``/health`` endpoint **should not** be used to determine the health status of the application. The return code is only indicative of the state of the rest call (200 for success). - diff --git a/docs/howto/connection/grpc.rst b/docs/howto/connection/grpc.rst index 9f922d5766038..3168cb08684c5 100644 --- a/docs/howto/connection/grpc.rst +++ b/docs/howto/connection/grpc.rst @@ -70,4 +70,4 @@ Scopes (comma separated) (Optional) A list of comma-separated `Google Cloud scopes `_ to authenticate with. - Only for `OATH_GOOGLE` type connection \ No newline at end of file + Only for `OATH_GOOGLE` type connection diff --git a/docs/scheduler.rst b/docs/scheduler.rst index 4d99e100b060f..8e23dc23bc44f 100644 --- a/docs/scheduler.rst +++ b/docs/scheduler.rst @@ -183,4 +183,3 @@ Here are some of the ways you can **unblock tasks**: or for instance when the fix has been applied outside of Airflow. * The ``airflow backfill`` CLI subcommand has a flag to ``--mark_success`` and allows selecting subsections of the DAG as well as specifying date ranges. - diff --git a/docs/security.rst b/docs/security.rst index 4058ddfe61c0e..d3360ebb0ea93 100644 --- a/docs/security.rst +++ b/docs/security.rst @@ -589,4 +589,3 @@ DAG Level Role ``Admin`` can create a set of roles which are only allowed to view a certain set of dags. This is called DAG level access. Each dag defined in the dag model table is treated as a ``View`` which has two permissions associated with it (``can_dag_read`` and ``can_dag_edit``). There is a special view called ``all_dags`` which allows the role to access all the dags. The default ``Admin``, ``Viewer``, ``User``, ``Op`` roles can all access ``all_dags`` view. - diff --git a/docs/timezone.rst b/docs/timezone.rst index 2894713ec698b..afdb42f6cbd6c 100644 --- a/docs/timezone.rst +++ b/docs/timezone.rst @@ -160,4 +160,3 @@ Time deltas For schedules with time deltas Airflow assumes you always will want to run with the specified interval. So if you specify a timedelta(hours=2) you will always want to run to hours later. In this case day light savings time will be taken into account. - diff --git a/licenses/LICENSE-bootstrap.txt b/licenses/LICENSE-bootstrap.txt index 69837f2c9da3a..1381cb2be454b 100644 --- a/licenses/LICENSE-bootstrap.txt +++ b/licenses/LICENSE-bootstrap.txt @@ -20,4 +20,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/licenses/LICENSE-d3-tip.txt b/licenses/LICENSE-d3-tip.txt index f57c5f0f779d3..106ce3f70fef3 100644 --- a/licenses/LICENSE-d3-tip.txt +++ b/licenses/LICENSE-d3-tip.txt @@ -14,4 +14,3 @@ TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONIN THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/licenses/LICENSE-d3js.txt b/licenses/LICENSE-d3js.txt index 0498d21d030ca..1d9d875edb469 100644 --- a/licenses/LICENSE-d3js.txt +++ b/licenses/LICENSE-d3js.txt @@ -25,6 +25,3 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - diff --git a/licenses/LICENSE-dagre-d3.txt b/licenses/LICENSE-dagre-d3.txt index 7cc5485d3def1..7d7dd94248124 100644 --- a/licenses/LICENSE-dagre-d3.txt +++ b/licenses/LICENSE-dagre-d3.txt @@ -17,5 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - diff --git a/licenses/LICENSE-datatables.txt b/licenses/LICENSE-datatables.txt index 57994fa2fe860..2c75762c8f235 100644 --- a/licenses/LICENSE-datatables.txt +++ b/licenses/LICENSE-datatables.txt @@ -14,4 +14,3 @@ TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONIN THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/licenses/LICENSE-elasticmock.txt b/licenses/LICENSE-elasticmock.txt index ea757fb172c9e..ecc244bfcde94 100644 --- a/licenses/LICENSE-elasticmock.txt +++ b/licenses/LICENSE-elasticmock.txt @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/licenses/LICENSE-flask-kerberos.txt b/licenses/LICENSE-flask-kerberos.txt index 7de99d46a8adf..82bc5b5beb872 100644 --- a/licenses/LICENSE-flask-kerberos.txt +++ b/licenses/LICENSE-flask-kerberos.txt @@ -20,4 +20,3 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/licenses/LICENSE-webgl-2d.txt b/licenses/LICENSE-webgl-2d.txt index 463d63a967fbe..f117260e548e3 100644 --- a/licenses/LICENSE-webgl-2d.txt +++ b/licenses/LICENSE-webgl-2d.txt @@ -18,6 +18,3 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - - diff --git a/scripts/ci/kubernetes/docker/bootstrap.sh b/scripts/ci/kubernetes/docker/bootstrap.sh index fc87f1b03fef0..27a6dbb35c4ef 100644 --- a/scripts/ci/kubernetes/docker/bootstrap.sh +++ b/scripts/ci/kubernetes/docker/bootstrap.sh @@ -21,10 +21,10 @@ if [[ "$1" = "webserver" ]] then - exec airflow webserver + exec airflow webserver fi if [[ "$1" = "scheduler" ]] then - exec airflow scheduler + exec airflow scheduler fi diff --git a/scripts/ci/minikdc.properties b/scripts/ci/minikdc.properties index 24e5a37d0176b..b11d0f68ddab5 100644 --- a/scripts/ci/minikdc.properties +++ b/scripts/ci/minikdc.properties @@ -25,4 +25,3 @@ max.ticket.lifetime=86400000 max.renewable.lifetime=604800000 transport=TCP debug=true - diff --git a/scripts/systemd/airflow b/scripts/systemd/airflow index 6d4bba2ee9fe0..10690128f8a18 100644 --- a/scripts/systemd/airflow +++ b/scripts/systemd/airflow @@ -21,4 +21,3 @@ # # AIRFLOW_CONFIG= # AIRFLOW_HOME= - diff --git a/scripts/systemd/airflow-flower.service b/scripts/systemd/airflow-flower.service index d031221deeb91..e4ab31ac6ed46 100644 --- a/scripts/systemd/airflow-flower.service +++ b/scripts/systemd/airflow-flower.service @@ -31,4 +31,4 @@ Restart=on-failure RestartSec=5s [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target diff --git a/scripts/systemd/airflow-kerberos.service b/scripts/systemd/airflow-kerberos.service index 21c06a6d03b1d..92a56eceee570 100644 --- a/scripts/systemd/airflow-kerberos.service +++ b/scripts/systemd/airflow-kerberos.service @@ -31,4 +31,4 @@ Restart=on-failure RestartSec=5s [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target diff --git a/scripts/systemd/airflow-worker.service b/scripts/systemd/airflow-worker.service index 5478173b3915c..330590f72158a 100644 --- a/scripts/systemd/airflow-worker.service +++ b/scripts/systemd/airflow-worker.service @@ -31,4 +31,4 @@ Restart=on-failure RestartSec=10s [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=multi-user.target