Add pre-commit check to sort and remove duplicates from the spelling wordlist (#13170)

This commit is contained in:
John Bampton 2021-03-01 02:26:13 +10:00 коммит произвёл GitHub
Родитель a1097f6f29
Коммит 53b9062f9e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 57 добавлений и 16 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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:

Просмотреть файл

@ -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.

Просмотреть файл

@ -132,6 +132,7 @@ setup-order
setup-extra-packages
shellcheck
sort-in-the-wild
sort-spelling-wordlist
stylelint
trailing-whitespace
update-breeze-file

Просмотреть файл

@ -15,8 +15,6 @@ Ansible
AppBuilder
Arg
Args
asctime
ashb
Async
Atlassian
Auth
@ -147,6 +145,7 @@ Flink
FluentD
Fokko
Formaturas
Fspark
Fundera
GCS
GH
@ -238,10 +237,10 @@ Lyft
Maheshwari
Makefile
Mapreduce
Mariadb
Masternode
Maxime
Memorystore
Mariadb
Mesos
MessageAttributes
Metastore
@ -313,6 +312,7 @@ Reddit
Redhat
ReidentifyContentResponse
Reinitialising
ResourceRequirements
Riccomini
Roadmap
Robinhood
@ -353,7 +353,6 @@ SubscriberClient
Subtasks
Sumit
Systemd
Terraform
TCP
TLS
TTY
@ -363,6 +362,7 @@ Taskfail
Templated
Templating
Teradata
Terraform
TextToSpeechClient
Tez
Thinknear
@ -390,6 +390,7 @@ Vertica
Vevo
VideoIntelligenceServiceClient
Vikram
VolumeMount
WTF
WaiterModel
Wasb
@ -478,17 +479,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
@ -1146,7 +1147,6 @@ repo
repos
reqs
resetdb
ResourceRequirements
resourceVersion
resultset
resumable
@ -1158,8 +1158,8 @@ romeoandjuliet
rootcss
rowid
rpc
rshift
rsa
rshift
rst
rtype
ru
@ -1207,8 +1207,8 @@ sigv
skipable
sku
sla
slackclient
slack_sdk
slackclient
slas
smtp
sortable
@ -1278,16 +1278,16 @@ superclass
svg
swp
symlink
symlinks
symlinking
symlinks
sync'ed
sys
syspath
systemd
tableId
tableau
tableauserverclient
tablefmt
tableId
tagKey
tagValue
tao
@ -1382,7 +1382,6 @@ videointelligence
vikramkoka
virtualenv
vm
VolumeMount
volumeMounts
wasb
webProperty

Просмотреть файл

@ -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}"