Skip to content

Commit f69b5d2

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 a9db3a0 commit f69b5d2

File tree

7 files changed

+196
-4
lines changed

7 files changed

+196
-4
lines changed

.aspell.en.pws

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

.circleci/config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
- run:
3939
name: ️️🏗️ pip dev requirements
4040
command: |
41+
sudo apt update
42+
sudo apt install aspell
4143
sudo pip install --upgrade virtualenv --progress-bar off
4244
python -m venv venv || virtualenv venv && . venv/bin/activate
4345
pip install -e . --no-cache-dir -r requires-install.txt -r requires-dev.txt -r requires-testing.txt --progress-bar off
@@ -46,7 +48,7 @@ jobs:
4648
paths:
4749
- venv
4850
- run:
49-
name: 🌸 Python & JS Lint
51+
name: 🌸 Python & JS Lint, Check Markdown Spelling
5052
command: |
5153
. venv/bin/activate
5254
set -eo pipefail
@@ -56,6 +58,7 @@ jobs:
5658
pylint tests/unit tests/integration/devtools tests/integration/renderer tests/integration/dash_assets -d all -e C0410,C0411,C0412,C0413,W0109
5759
cd dash-renderer && npm ci
5860
npm run lint:test && npm run format:test
61+
cd .. && sh ./check-spelling.sh || exit 1
5962
- run:
6063
name: 🐍 Python Unit Tests
6164
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## [1.8.0] - 2020-01-14
66
### Added
7+
- [#1081](https://github.com/plotly/dash/pull/1081) Add spell checking for Markdown files to CircleCI via GNU Aspell.
78
- [#1073](https://github.com/plotly/dash/pull/1073) Two new functions to simplify usage handling URLs and pathnames: `app.get_relative_path` & `app.trim_relative_path`.
89
These functions are particularly useful for apps deployed on Dash Enterprise where the apps served under a URL prefix (the app name) which is unlike apps served on localhost:8050.
910
- `app.get_relative_path` returns a path with the config setting `requests_pathname_prefix` prefixed. Use `app.get_relative_path` anywhere you would provide a relative pathname, like `dcc.Link(href=app.relative_path('/page-2'))` or even as an alternative to `app.get_asset_url` with e.g. `html.Img(src=app.get_relative_path('/assets/logo.png'))`.

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,18 @@ We use both `flake8` and `pylint` for basic linting check, please refer to the r
100100

101101
Note that we also start using [`black`](https://black.readthedocs.io/en/stable/) as formatter during the test code migration.
102102

103+
### Spell Checking
104+
105+
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.
106+
107+
[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:
108+
109+
```
110+
man aspell
111+
```
112+
113+
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.
114+
103115
## Tests
104116

105117
We started migrating to [pytest](https://docs.pytest.org/en/latest/) from `unittest` as our test automation framework. You will see more testing enhancements in the near future.

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
@@ -8,4 +8,4 @@ pylint==2.3.1;python_version=="3.7"
88
astroid==2.2.5;python_version=="3.7"
99
virtualenv;python_version=="2.7"
1010
fire
11-
coloredlogs
11+
coloredlogs

0 commit comments

Comments
 (0)