Skip to content

Commit

Permalink
Add pre-commit check to sort and remove duplicates from the spelling …
Browse files Browse the repository at this point in the history
…wordlist (apache#13170)
  • Loading branch information
jbampton authored Feb 28, 2021
1 parent a1097f6 commit 53b9062
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 16 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,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
Expand Down
5 changes: 3 additions & 2 deletions BREEZE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions STATIC_CODE_CHECKS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,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.
Expand Down
1 change: 1 addition & 0 deletions breeze-complete
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ setup-order
setup-extra-packages
shellcheck
sort-in-the-wild
sort-spelling-wordlist
stylelint
trailing-whitespace
update-breeze-file
Expand Down
27 changes: 13 additions & 14 deletions docs/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ Ansible
AppBuilder
Arg
Args
asctime
ashb
Async
Atlassian
Auth
Expand Down Expand Up @@ -147,6 +145,7 @@ Flink
FluentD
Fokko
Formaturas
Fspark
Fundera
GCS
GH
Expand Down Expand Up @@ -238,10 +237,10 @@ Lyft
Maheshwari
Makefile
Mapreduce
Mariadb
Masternode
Maxime
Memorystore
Mariadb
Mesos
MessageAttributes
Metastore
Expand Down Expand Up @@ -313,6 +312,7 @@ Reddit
Redhat
ReidentifyContentResponse
Reinitialising
ResourceRequirements
Riccomini
Roadmap
Robinhood
Expand Down Expand Up @@ -353,7 +353,6 @@ SubscriberClient
Subtasks
Sumit
Systemd
Terraform
TCP
TLS
TTY
Expand All @@ -363,6 +362,7 @@ Taskfail
Templated
Templating
Teradata
Terraform
TextToSpeechClient
Tez
Thinknear
Expand Down Expand Up @@ -390,6 +390,7 @@ Vertica
Vevo
VideoIntelligenceServiceClient
Vikram
VolumeMount
WTF
WaiterModel
Wasb
Expand Down Expand Up @@ -478,17 +479,17 @@ autoscaling
avro
aws
awsbatch
backcompat
backend
backends
backcompat
backfill
backfilled
backfilling
backfills
backoff
backport
backports
backported
backports
backreference
backtick
backticks
Expand Down Expand Up @@ -1024,13 +1025,13 @@ openfaas
oper
opsgenie
optimise
optionality
ora
orm
orchestrator
orgtbl
orm
os
ot
optionality
overridable
oversubscription
pagerduty
Expand Down Expand Up @@ -1146,7 +1147,6 @@ repo
repos
reqs
resetdb
ResourceRequirements
resourceVersion
resultset
resumable
Expand All @@ -1158,8 +1158,8 @@ romeoandjuliet
rootcss
rowid
rpc
rshift
rsa
rshift
rst
rtype
ru
Expand Down Expand Up @@ -1207,8 +1207,8 @@ sigv
skipable
sku
sla
slackclient
slack_sdk
slackclient
slas
smtp
sortable
Expand Down Expand Up @@ -1278,16 +1278,16 @@ superclass
svg
swp
symlink
symlinks
symlinking
symlinks
sync'ed
sys
syspath
systemd
tableId
tableau
tableauserverclient
tablefmt
tableId
tagKey
tagValue
tao
Expand Down Expand Up @@ -1382,7 +1382,6 @@ videointelligence
vikramkoka
virtualenv
vm
VolumeMount
volumeMounts
wasb
webProperty
Expand Down
32 changes: 32 additions & 0 deletions scripts/ci/pre_commit/pre_commit_sort_spelling_wordlist.sh
Original file line number Diff line number Diff line change
@@ -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}"

0 comments on commit 53b9062

Please sign in to comment.