This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v2-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit cdcbfb4e013807f6a0688f80af2d982eb9e9a8ea
Author: John Bampton <[email protected]>
AuthorDate: Mon Mar 1 02:26:13 2021 +1000

    Add pre-commit check to sort and remove duplicates from the spelling 
wordlist (#13170)
    
    (cherry picked from commit 53b9062f9e845fc732417ffdbcb6717553d45fae)
---
 .pre-commit-config.yaml                            |  6 ++++
 BREEZE.rst                                         |  5 ++--
 STATIC_CODE_CHECKS.rst                             |  2 ++
 breeze-complete                                    |  1 +
 docs/spelling_wordlist.txt                         | 26 +++++++++---------
 .../pre_commit_sort_spelling_wordlist.sh           | 32 ++++++++++++++++++++++
 6 files changed, 57 insertions(+), 15 deletions(-)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index aea91e3..e30b2f2 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -408,6 +408,12 @@ repos:
         language: system
         files: ^.pre-commit-config.yaml$|^INTHEWILD.md$
         require_serial: true
+      - id: sort-spelling-wordlist
+        name: Sort alphabetically and uniquify spelling_wordlist.txt
+        entry: ./scripts/ci/pre_commit/pre_commit_sort_spelling_wordlist.sh
+        language: system
+        files: ^.pre-commit-config.yaml$|^docs/spelling_wordlist.txt$
+        require_serial: true
       - id: helm-lint
         name: Lint Helm Chart
         entry: ./scripts/ci/pre_commit/pre_commit_helm_lint.sh
diff --git a/BREEZE.rst b/BREEZE.rst
index 57855b2..4f78977 100644
--- a/BREEZE.rst
+++ b/BREEZE.rst
@@ -2279,8 +2279,9 @@ This is the current syntax for  `./breeze <./breeze>`_:
                  pre-commit-hook-names provide-create-sessions 
providers-init-file provider-yamls
                  pydevd pydocstyle pylint pylint-tests python-no-log-warn 
pyupgrade
                  restrict-start_date rst-backticks setup-order 
setup-extra-packages shellcheck
-                 sort-in-the-wild stylelint trailing-whitespace 
update-breeze-file update-extras
-                 update-local-yml-file update-setup-cfg-file version-sync 
yamllint
+                 sort-in-the-wild sort-spelling-wordlist stylelint 
trailing-whitespace
+                 update-breeze-file update-extras update-local-yml-file 
update-setup-cfg-file
+                 version-sync yamllint
 
         You can pass extra arguments including options to to the pre-commit 
framework as
         <EXTRA_ARGS> passed after --. For example:
diff --git a/STATIC_CODE_CHECKS.rst b/STATIC_CODE_CHECKS.rst
index 55674bf..13ac4e9 100644
--- a/STATIC_CODE_CHECKS.rst
+++ b/STATIC_CODE_CHECKS.rst
@@ -162,6 +162,8 @@ require Breeze Docker images to be installed locally:
 ----------------------------------- 
---------------------------------------------------------------- ------------
 ``sort-in-the-wild``                  Sort INTHEWILD.md alphabetically.
 ----------------------------------- 
---------------------------------------------------------------- ------------
+``sort-spelling-wordlist``            Sort alphabetically and uniquify 
spelling_wordlist.txt.
+----------------------------------- 
---------------------------------------------------------------- ------------
 ``stylelint``                         Checks CSS files with stylelint.
 ----------------------------------- 
---------------------------------------------------------------- ------------
 ``trailing-whitespace``               Removes trailing whitespace at end of 
line.
diff --git a/breeze-complete b/breeze-complete
index 0c53da5..962aaa6 100644
--- a/breeze-complete
+++ b/breeze-complete
@@ -131,6 +131,7 @@ setup-order
 setup-extra-packages
 shellcheck
 sort-in-the-wild
+sort-spelling-wordlist
 stylelint
 trailing-whitespace
 update-breeze-file
diff --git a/docs/spelling_wordlist.txt b/docs/spelling_wordlist.txt
index 322ce7b..5284966 100644
--- a/docs/spelling_wordlist.txt
+++ b/docs/spelling_wordlist.txt
@@ -14,8 +14,6 @@ Ansible
 AppBuilder
 Arg
 Args
-asctime
-ashb
 Async
 Atlassian
 Auth
@@ -145,6 +143,7 @@ Flink
 FluentD
 Fokko
 Formaturas
+Fspark
 Fundera
 GCS
 GH
@@ -236,10 +235,10 @@ Lyft
 Maheshwari
 Makefile
 Mapreduce
+Mariadb
 Masternode
 Maxime
 Memorystore
-Mariadb
 Mesos
 MessageAttributes
 Metastore
@@ -311,6 +310,7 @@ Reddit
 Redhat
 ReidentifyContentResponse
 Reinitialising
+ResourceRequirements
 Riccomini
 Roadmap
 Robinhood
@@ -351,7 +351,6 @@ SubscriberClient
 Subtasks
 Sumit
 Systemd
-Terraform
 TCP
 TLS
 TTY
@@ -361,6 +360,7 @@ Taskfail
 Templated
 Templating
 Teradata
+Terraform
 TextToSpeechClient
 Tez
 Thinknear
@@ -388,6 +388,7 @@ Vertica
 Vevo
 VideoIntelligenceServiceClient
 Vikram
+VolumeMount
 WTF
 WaiterModel
 Wasb
@@ -476,17 +477,17 @@ autoscaling
 avro
 aws
 awsbatch
+backcompat
 backend
 backends
-backcompat
 backfill
 backfilled
 backfilling
 backfills
 backoff
 backport
-backports
 backported
+backports
 backreference
 backtick
 backticks
@@ -1024,13 +1025,13 @@ openfaas
 oper
 opsgenie
 optimise
+optionality
 ora
-orm
 orchestrator
 orgtbl
+orm
 os
 ot
-optionality
 overridable
 oversubscription
 pagerduty
@@ -1145,7 +1146,6 @@ repo
 repos
 reqs
 resetdb
-ResourceRequirements
 resourceVersion
 resultset
 resumable
@@ -1157,8 +1157,8 @@ romeoandjuliet
 rootcss
 rowid
 rpc
-rshift
 rsa
+rshift
 rst
 rtype
 ru
@@ -1206,8 +1206,8 @@ sigv
 skipable
 sku
 sla
-slackclient
 slack_sdk
+slackclient
 slas
 smtp
 sortable
@@ -1277,12 +1277,13 @@ superclass
 svg
 swp
 symlink
-symlinks
 symlinking
+symlinks
 sync'ed
 sys
 syspath
 systemd
+tableId
 tableau
 tableauserverclient
 tablefmt
@@ -1380,7 +1381,6 @@ videointelligence
 vikramkoka
 virtualenv
 vm
-VolumeMount
 volumeMounts
 wasb
 webProperty
diff --git a/scripts/ci/pre_commit/pre_commit_sort_spelling_wordlist.sh 
b/scripts/ci/pre_commit/pre_commit_sort_spelling_wordlist.sh
new file mode 100755
index 0000000..9b309b9
--- /dev/null
+++ b/scripts/ci/pre_commit/pre_commit_sort_spelling_wordlist.sh
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+# 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.
+
+# shellcheck source=scripts/ci/libraries/_script_init.sh
+. "$( dirname "${BASH_SOURCE[0]}" )/../libraries/_script_init.sh"
+
+SPELLING_WORDLIST="${AIRFLOW_SOURCES}/docs/spelling_wordlist.txt"
+readonly SPELLING_WORDLIST
+
+export LC_ALL=C
+
+temp_file=$(mktemp)
+< "${SPELLING_WORDLIST}" sort | uniq > "${temp_file}"
+
+cat "${temp_file}" > "${SPELLING_WORDLIST}"
+
+rm  "${temp_file}"

Reply via email to