Skip to content

Commit 6d0e3d8

Browse files
committed
Spellcheck documentation
1 parent 8aa4ebd commit 6d0e3d8

File tree

9 files changed

+628
-20
lines changed

9 files changed

+628
-20
lines changed

.github/workflows/validate-on-push.yml

+11
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,14 @@ jobs:
6363
with:
6464
php_version: '8.1'
6565
command: test
66+
67+
spellchecker:
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v3
71+
- uses: borales/actions-yarn@v3
72+
with:
73+
cmd: install
74+
- uses: borales/actions-yarn@v3
75+
with:
76+
cmd: spellcheck

.spelling

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# markdown-spellcheck spelling configuration file
2+
# Format - lines beginning # are comments
3+
# global dictionary is at the start, file overrides afterwards
4+
# one word per line, to define a file override use ' - filename'
5+
# where filename is relative to this configuration file
6+
PHPUnit
7+
WordPress
8+
PHP_CodeSniffer
9+
rulesets
10+
e.g.
11+
metadata
12+
i.e.
13+
1990s
14+
Exif
15+
2000s
16+
hardcrops
17+
hardcrop
18+
dchesterton
19+
5.6
20+
5.1
21+
subfolders
22+
subfolder
23+
composer.json
24+
namespace
25+
lourot
26+
frameright
27+
6.0
28+
GPLv3
29+
0.0.3
30+
changelog
31+
0.0.2
32+
2022-10-31
33+
0.0.1
34+
2022-10-27

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ rotated to best fit a given container. The
3737
Regions and insert them in the metadata of a picture.
3838

3939
This WordPress plugin reads such Image Regions in order to automatically crop
40-
images the best possible way, dependending on which container they are being
40+
images the best possible way, depending on which container they are being
4141
displayed in.
4242

4343
## How does it work?

bin/yarn.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env sh
2+
3+
# On some systems, 'yarn' is named 'yarnpkg', thus this wrapper.
4+
5+
if which yarn; then
6+
yarn "$@"
7+
exit $?
8+
fi
9+
if which yarnpkg; then
10+
yarnpkg "$@"
11+
exit $?
12+
fi
13+
echo yarn not installed?
14+
exit 1

composer.json

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"phpunit/phpunit": "^9.5.25"
44
},
55
"scripts": {
6-
"format": "yarn run prettier --write . || yarnpkg run prettier --write .",
76
"lint": "./wpcs/vendor/bin/phpcs",
87
"test": "./vendor/bin/phpunit"
98
}

docs/contributing.md

+28-16
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
# Contributing
22

3-
## Running the unit tests
3+
## Code formatting
44

5-
### Setting up PHPUnit
5+
Pull and run [prettier](https://github.com/prettier/plugin-php) with:
6+
7+
```bash
8+
$ yarn install # pull
9+
$ yarn format # run
10+
```
11+
12+
## Validating
13+
14+
### Running the unit tests
15+
16+
#### Setting up PHPUnit
617

718
Install [PHPUnit](https://phpunit.readthedocs.io/en/9.5/installation.html)
819
with:
@@ -12,26 +23,17 @@ $ sudo apt install composer
1223
$ composer install
1324
```
1425

15-
### Running PHPUnit
26+
#### Running PHPUnit
1627

1728
Run the unit tests with:
1829

1930
```bash
2031
$ composer test
2132
```
2233

23-
## Formatting the code
34+
### Validating against WordPress coding standards
2435

25-
Pull and run [prettier](https://github.com/prettier/plugin-php) with:
26-
27-
```bash
28-
$ yarn install # pull
29-
$ composer format # run
30-
```
31-
32-
## Validating against WordPress coding standards
33-
34-
### Setting up PHP_CodeSniffer
36+
#### Setting up PHP_CodeSniffer
3537

3638
First pull the
3739
[WordPress coding standards](https://github.com/WordPress/WordPress-Coding-Standards)
@@ -74,15 +76,15 @@ $ docker run --rm -it --volume $PWD:/app -u `id -u`:`id -g` \
7476
$ popd
7577
```
7678

77-
### Running PHP_CodeSniffer
79+
#### Running PHP_CodeSniffer
7880

7981
Run PHP_CodeSniffer with:
8082

8183
```bash
8284
$ composer lint
8385
```
8486

85-
## Building the plugin as a ZIP file
87+
### Building the plugin as a ZIP file
8688

8789
Either build the package locally by committing your changes and running:
8890

@@ -95,3 +97,13 @@ or push your branch up to GitHub and download it from
9597
e.g.
9698
https://github.com/Frameright/image-display-control-wordpress/archive/refs/heads/master.zip
9799
.
100+
101+
### Spellchecking the documentation
102+
103+
Pull and run [`mdspell`](https://github.com/lukeapage/node-markdown-spellcheck)
104+
with:
105+
106+
```bash
107+
$ yarn install # pull
108+
$ yarn spellcheck # run
109+
```

package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{
22
"dependencies": {
33
"@prettier/plugin-php": "^0.19.1",
4-
"prettier": "^2.7.1"
4+
"prettier": "^2.7.1",
5+
"markdown-spellcheck": "^1.3.1"
6+
},
7+
"scripts": {
8+
"format": "./bin/yarn.sh run prettier --write .",
9+
"spellcheck": "./bin/yarn.sh run mdspell '**/*.md' 'readme.txt' '!node_modules/**' '!**/vendor/**' '!wpcs/**' --ignore-acronyms --no-suggestions --en-us"
510
}
611
}

readme.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ of the image (e.g. objects, people) or for indicating how the image should be
1919
cropped or rotated to best fit a given container.
2020

2121
This WordPress plugin reads such image regions in order to automatically crop
22-
images the best possible way, dependending on which container they are being
22+
images the best possible way, depending on which container they are being
2323
displayed in.
2424

2525
The [Frameright app](https://frameright.app/) can be used to define such image

0 commit comments

Comments
 (0)