Skip to content

Commit 98c5567

Browse files
committed
🧹 Add spell checking for Markdown files to CircleCI via GNU Aspell.
Install aspell on CircleCI. Add a custom dictionary file. Spell check the Markdown files with a shell script. Add section on spell checking to the contributing guide. Update the CHANGELOG.
1 parent 2c166bb commit 98c5567

File tree

7 files changed

+214
-5
lines changed

7 files changed

+214
-5
lines changed

.aspell.en.pws

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
personal_ws-1.1 en 158
2+
ALLSMALLER
3+
APIs
4+
ActionChain
5+
AppProvider
6+
CDN
7+
CHANGELOG
8+
CSRF
9+
CircleCI
10+
Clientside
11+
ComponentRegistry
12+
Crossfiltering
13+
DOM
14+
DataFrame
15+
DependencyException
16+
Dev
17+
Dropdown
18+
ENV
19+
GitHub
20+
Homebrew
21+
IDEs
22+
InvalidIndexException
23+
InvalidResourceError
24+
JS
25+
JSON
26+
KeyError
27+
LGTM
28+
MacOS
29+
MacPorts
30+
Mapbox
31+
MERCHANTABILITY
32+
MutableMapping
33+
NONINFRINGEMENT
34+
Plotly
35+
Plotly's
36+
Plotlyers
37+
PreventUpdate
38+
PropTypes
39+
PyPI
40+
README
41+
Redux
42+
Renderer
43+
ResourceException
44+
Submodules
45+
TODO
46+
TreeContainer
47+
UI
48+
WebDriver
49+
abc
50+
analytics
51+
api
52+
arg
53+
args
54+
aspell
55+
assignees
56+
async
57+
asyncDecorator
58+
auth
59+
backend
60+
backends
61+
bool
62+
cbcx
63+
cbwc
64+
cd
65+
cheatsheet
66+
chris
67+
cli
68+
clientside
69+
compat
70+
config
71+
configs
72+
coord
73+
css
74+
customizable
75+
cwd
76+
dashR
77+
dashr
78+
dcc
79+
defaultdict
80+
dev
81+
devtools
82+
dicts
83+
docgen
84+
docstring
85+
docstrings
86+
dom
87+
dropdown
88+
dropdowns
89+
eg
90+
elif
91+
endline
92+
env
93+
environ
94+
etag
95+
favicon
96+
formatter
97+
frontend
98+
gunicorn
99+
hocho
100+
html
101+
http
102+
ie
103+
iframe
104+
init
105+
iOS
106+
javascript
107+
js
108+
json
109+
kwargs
110+
lang
111+
lf
112+
localhost
113+
ly
114+
md
115+
middleware
116+
montreal
117+
msec
118+
namespace
119+
namespaces
120+
npm
121+
optionals
122+
pathname
123+
pathnames
124+
pdb
125+
percy
126+
plotly
127+
polyfills
128+
proxied
129+
py
130+
pylint
131+
pytest
132+
pytest's
133+
redux
134+
renderer
135+
repo
136+
repos
137+
repr
138+
scalability
139+
serializable
140+
serverside
141+
setProps
142+
sexualized
143+
src
144+
subdirectory
145+
sublicense
146+
superset
147+
supress
148+
tada
149+
tracebacks
150+
ui
151+
unittest
152+
updateProps
153+
url
154+
urls
155+
utf
156+
venv
157+
virtualenv
158+
walmart
159+
whatwg

.circleci/config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
- run:
4141
name: ️️🏗️ pip dev requirements
4242
command: |
43+
sudo apt update
44+
sudo apt install aspell
4345
sudo pip install --upgrade virtualenv --progress-bar off
4446
python -m venv venv || virtualenv venv && . venv/bin/activate
4547
pip install -e . --no-cache-dir -r requires-install.txt -r requires-dev.txt -r requires-testing.txt --progress-bar off
@@ -48,13 +50,14 @@ jobs:
4850
paths:
4951
- venv
5052
- run:
51-
name: 🌸 Python & JS Lint
53+
name: 🌸 Python & JS Lint, Check Markdown Spelling
5254
command: |
5355
. venv/bin/activate
5456
set -eo pipefail
5557
pip install -e . --progress-bar off && pip list | grep dash
5658
npm install --production && npm run initialize
5759
npm run lint
60+
sh ./check-spelling.sh || exit 1
5861
- run:
5962
name: 🐍 Python Unit Tests & ☕ JS Unit Tests
6063
command: |

.github/pull_request_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212

1313
- [ ] I have added entry in the `CHANGELOG.md`
1414
- [ ] If this PR needs a follow-up in **dash docs**, **community thread**, I have mentioned the relevant URLS as follow
15-
- [ ] this github [#PR number]() updates the dash docs
16-
- [ ] here is the show and tell thread in plotly dash community
15+
- [ ] this GitHub [#PR number]() updates the dash docs
16+
- [ ] here is the show and tell thread in Plotly dash community

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
All notable changes to `dash` will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5-
## [1.13.4] - 2020-06-25
5+
## [Unreleased]
6+
### Added
7+
- [#1081](https://github.com/plotly/dash/pull/1081) Add spell checking for Markdown files to CircleCI via GNU Aspell.
8+
9+
## [1.13.4] - 2020-06-25
610
### Fixed
711
- [#1310](https://github.com/plotly/dash/pull/1310) Fix a regression since 1.13.0 preventing more than one loading state from being shown at a time.
812

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ Emojis make the commit messages :cherry_blossom:. If you have no idea about what
101101

102102
We use `flake8`, `pylint`, and [`black`](https://black.readthedocs.io/en/stable/) for linting. please refer to the relevant steps in `.circleci/config.yml`.
103103

104+
### Spell Checking
105+
106+
We use [GNU Aspell](http://aspell.net/) to check the spelling of the Markdown files. [GNU Aspell](https://en.wikipedia.org/wiki/GNU_Aspell) is a free and open source spell checker designed to eventually replace Ispell. It compiles for Unix-like operating systems and Windows. Refer to the relevant step in `.circleci/config.yml` to see the Aspell implementation.
107+
108+
[GNU Aspell](https://github.com/GNUAspell/aspell) can also be installed on MacOS via [Homebrew](https://formulae.brew.sh/formula/aspell) and with [MacPorts](https://www.macports.org/ports.php?by=library&substr=aspell) and includes a man page:
109+
110+
```
111+
man aspell
112+
```
113+
114+
We use a [shell script](https://en.wikipedia.org/wiki/Shell_script) to check the spelling of the Markdown files and print out a list of words not in our dictionary and fail the build if new words are found.
115+
104116
## Tests
105117

106118
Our tests use Google Chrome via Selenium. You will need to install [ChromeDriver](http://chromedriver.chromium.org/getting-started) matching the version of Chrome installed on your system. Here are some helpful tips for [Mac](https://www.kenst.com/2015/03/installing-chromedriver-on-mac-osx/) and [Windows](http://jonathansoma.com/lede/foundations-2018/classes/selenium/selenium-windows-install/).

check-spelling.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
errors=0
4+
path="tests/spelling/"
5+
mkdir -p $path
6+
misspelled="$path"misspelled-words.txt
7+
if [ -f $misspelled ] ; then
8+
rm $misspelled
9+
fi
10+
for file in $(find . -name "*.md" -not -path "**/node_modules/*");
11+
do
12+
echo "$file" >> "$path"misspelled-words-temp.txt
13+
aspell list --lang=en --encoding=utf-8 --personal=./.aspell.en.pws < "$file" | sort -u >> "$path"misspelled-words-temp.txt
14+
if [ "$(wc -l <"$path"misspelled-words-temp.txt)" -ge 2 ]
15+
then
16+
echo >> "$path"misspelled-words-temp.txt
17+
cat "$path"misspelled-words-temp.txt
18+
cat "$path"misspelled-words-temp.txt >> "$path"misspelled-words.txt
19+
errors=1
20+
fi
21+
:> "$path"misspelled-words-temp.txt
22+
done
23+
if [ -f "$path"misspelled-words-temp.txt ] ; then
24+
rm "$path"misspelled-words-temp.txt
25+
fi
26+
if [ "$errors" -ge 1 ]
27+
then
28+
exit 1
29+
else
30+
exit 0
31+
fi

requires-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ astroid==2.2.5;python_version=="3.7"
1010
black==19.10b0;python_version>="3.0"
1111
virtualenv==20.0.10;python_version=="2.7"
1212
fire==0.2.1
13-
coloredlogs==14.0
13+
coloredlogs==14.0

0 commit comments

Comments
 (0)