Skip to content

Add spell checking for Markdown files to CircleCI via GNU Aspell. #1081

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 159 additions & 0 deletions .aspell.en.pws
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
personal_ws-1.1 en 158
ALLSMALLER
APIs
ActionChain
AppProvider
CDN
CHANGELOG
CSRF
CircleCI
Clientside
ComponentRegistry
Crossfiltering
DOM
DataFrame
DependencyException
Dev
Dropdown
ENV
GitHub
Homebrew
IDEs
InvalidIndexException
InvalidResourceError
JS
JSON
KeyError
LGTM
MacOS
MacPorts
Mapbox
MERCHANTABILITY
MutableMapping
NONINFRINGEMENT
Plotly
Plotly's
Plotlyers
PreventUpdate
PropTypes
PyPI
README
Redux
Renderer
ResourceException
Submodules
TODO
TreeContainer
UI
WebDriver
abc
analytics
api
arg
args
aspell
assignees
async
asyncDecorator
auth
backend
backends
bool
cbcx
cbwc
cd
cheatsheet
chris
cli
clientside
compat
config
configs
coord
css
customizable
cwd
dashR
dashr
dcc
defaultdict
dev
devtools
dicts
docgen
docstring
docstrings
dom
dropdown
dropdowns
eg
elif
endline
env
environ
etag
favicon
formatter
frontend
gunicorn
hocho
html
http
ie
iframe
init
iOS
javascript
js
json
kwargs
lang
lf
localhost
ly
md
middleware
montreal
msec
namespace
namespaces
npm
optionals
pathname
pathnames
pdb
percy
plotly
polyfills
proxied
py
pylint
pytest
pytest's
redux
renderer
repo
repos
repr
scalability
serializable
serverside
setProps
sexualized
src
subdirectory
sublicense
superset
supress
tada
tracebacks
ui
unittest
updateProps
url
urls
utf
venv
virtualenv
walmart
whatwg
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
- run:
name: ️️🏗️ pip dev requirements
command: |
sudo apt update
sudo apt install aspell
sudo pip install --upgrade virtualenv --progress-bar off
python -m venv venv || virtualenv venv && . venv/bin/activate
pip install -e . --no-cache-dir -r requires-install.txt -r requires-dev.txt -r requires-testing.txt --progress-bar off
Expand All @@ -48,13 +50,14 @@ jobs:
paths:
- venv
- run:
name: 🌸 Python & JS Lint
name: 🌸 Python & JS Lint, Check Markdown Spelling
command: |
. venv/bin/activate
set -eo pipefail
pip install -e . --progress-bar off && pip list | grep dash
npm install --production && npm run initialize
npm run lint
sh ./check-spelling.sh || exit 1
- run:
name: 🐍 Python Unit Tests & ☕ JS Unit Tests
command: |
Expand Down
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@

- [ ] I have added entry in the `CHANGELOG.md`
- [ ] If this PR needs a follow-up in **dash docs**, **community thread**, I have mentioned the relevant URLS as follow
- [ ] this github [#PR number]() updates the dash docs
- [ ] here is the show and tell thread in plotly dash community
- [ ] this GitHub [#PR number]() updates the dash docs
- [ ] here is the show and tell thread in Plotly dash community
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
All notable changes to `dash` will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [1.13.4] - 2020-06-25
## [Unreleased]
### Added
- [#1081](https://github.com/plotly/dash/pull/1081) Add spell checking for Markdown files to CircleCI via GNU Aspell.

## [1.13.4] - 2020-06-25
### Fixed
- [#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.

Expand Down
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@ Emojis make the commit messages :cherry_blossom:. If you have no idea about what

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

### Spell Checking

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.

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

```
man aspell
```

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.

## Tests

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/).
Expand Down
31 changes: 31 additions & 0 deletions check-spelling.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

errors=0
path="tests/spelling/"
mkdir -p $path
misspelled="$path"misspelled-words.txt
if [ -f $misspelled ] ; then
rm $misspelled
fi
for file in $(find . -name "*.md" -not -path "**/node_modules/*");
do
echo "$file" >> "$path"misspelled-words-temp.txt
aspell list --lang=en --encoding=utf-8 --personal=./.aspell.en.pws < "$file" | sort -u >> "$path"misspelled-words-temp.txt
if [ "$(wc -l <"$path"misspelled-words-temp.txt)" -ge 2 ]
then
echo >> "$path"misspelled-words-temp.txt
cat "$path"misspelled-words-temp.txt
cat "$path"misspelled-words-temp.txt >> "$path"misspelled-words.txt
errors=1
fi
:> "$path"misspelled-words-temp.txt
done
if [ -f "$path"misspelled-words-temp.txt ] ; then
rm "$path"misspelled-words-temp.txt
fi
if [ "$errors" -ge 1 ]
then
exit 1
else
exit 0
fi
2 changes: 1 addition & 1 deletion requires-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ astroid==2.2.5;python_version=="3.7"
black==19.10b0;python_version>="3.0"
virtualenv==20.0.10;python_version=="2.7"
fire==0.2.1
coloredlogs==14.0
coloredlogs==14.0