-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from djmattyg007/sorting-script
Make it so that anyone can easily check the sorting of dictionary lists
- Loading branch information
Showing
3 changed files
with
25 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
cd "$(dirname "$0")" | ||
|
||
# Sorting is locale-dependent, so force sort to use a locale that's always | ||
# available for consistency. | ||
export LC_ALL=C | ||
|
||
all_sorted="true" | ||
|
||
for file in "whitelist.txt" flake8_spellcheck/*.txt; do | ||
if [[ "$(sort < "$file")" != "$(<"$file")" ]]; then | ||
echo "$file is not sorted correctly" >&2 | ||
all_sorted="false" | ||
fi | ||
done | ||
|
||
if [[ "$all_sorted" == "false" ]]; then | ||
exit 1 | ||
fi |