Skip to content

Commit

Permalink
Spell checking CI integration (#13992)
Browse files Browse the repository at this point in the history
* Adds spell checking and fixes files.

This implements a package to spellcheck files, and
does a pass to ensure everything is green.

* [not verified] Implements Travis check for spelling

Adds Yarn script and Travis CI for spell checking.

* [not verified] Fixes feedback.

Updates docs to prevent spelling exceptions for certain files.
  • Loading branch information
ChaosExAnima authored and kraftbj committed Nov 15, 2019
1 parent 28904d8 commit b7229b4
Show file tree
Hide file tree
Showing 12 changed files with 310 additions and 33 deletions.
113 changes: 113 additions & 0 deletions .spelling
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
Jetpack
VaultPress
WordPress
Packagist
WP-CLI
rsync
wp-admin
config
WordPress.com
Jetpack-CLI
PHPUnit
xdebug
MailDev
NodeJS
ngrok
http
localhost
multisite
MySQL
tunnelling
namespace
Automattic
Automattician
sftp
PhpStorm
wp-content
jetpack
wordpress
ok
vscode
nvm
phpunit
repo
Node.js
i.e.
e.g.
keychain
GitHub.com
WooCommerce
CodeSniffer
macOS
Homebrew
installable
ESLint
rulesets
ruleset
PHPStorm
hostname
rebasing
rebase
unreviewed
triaged
jQuery
nonces
wp-json
stringified
Akismet
GlotPress
validator
iframe
Lodash
enqueued
polyfill
shortlinks
i18n
stylesheet
autoload
autoloader
webhook
ngrok.com
Customizer's
error_log
SCRIPT_DEBUG
JETPACK_DEV_DEBUG
jetpack_development_mode
admin.php
wp_localize_script
Automatticians
- docker/README.md
php-debug
pathMappings
v1.3
eu
ap
au
example.ngrok.io
www
html
- docs/development-environment.md
JETPACK__SANDBOX_DOMAIN
README.md
WP_DEBUG
mycooltestsite.local
- docs/pull-request.md
Pri
- docs/release-management.md
Subissue
- docs/rest-api.md
akismet
jurassic.ninja
ninjastic
v4
url
options_or_modules
- extensions/README.md
- docs/CONTRIBUTING.md
v2
GPLv2
- docs/translations.md
translate.wordpress.org.
WordPress.com.
- docs/development-environment-cli-support.md
php
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ matrix:
name: "Build dashboard & extensions"
language: node_js
env: WP_TRAVISCI="yarn build"
- if: branch !~ /(^branch-.*-built)/
name: "Spell check Markdown files"
language: node_js
env: WP_TRAVISCI="yarn test-spelling"
- php: "nightly"
name: "PHP Nightly"
- php: "7.4snapshot"
Expand Down Expand Up @@ -70,6 +74,7 @@ matrix:
allow_failures:
- name: "E2E tests"
- name: "PHP Nightly"
- name: "Spell check Markdown files"

cache:
directories:
Expand Down
20 changes: 10 additions & 10 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ yarn docker:phpunit:multisite --filter=Protect

### Starting over

To remove all docker images, all mysql data, and all docker-related files from your local machine run:
To remove all docker images, all MySQL data, and all docker-related files from your local machine run:

```sh
yarn docker:clean
Expand All @@ -177,7 +177,7 @@ For example run [`cron event list`](https://developer.wordpress.org/cli/commands
yarn docker:wp cron event list
```

[`shell`](https://developer.wordpress.org/cli/commands/shell/) is a handy wp-cli command you can use like so:
[`shell`](https://developer.wordpress.org/cli/commands/shell/) is a handy WP-CLI command you can use like so:

```bash
yarn docker:wp shell
Expand All @@ -204,7 +204,7 @@ Connecting to your MySQL database from outside the container, use:
- Pass: `wordpress`
- Database: `wordpress`

You can also see your database files via local filesystem at `./docker/data/mysql`
You can also see your database files via local file system at `./docker/data/mysql`

## SFTP access

Expand Down Expand Up @@ -238,7 +238,7 @@ If you use one-off domains, you'll have to re-install WordPress and re-connect J

If you're developing Jetpack often you'll want to reserve a domain you can keep using.

If you are an Automattician, sign up on Ngrok.com using your a8c Google account; you'll be automattically added to the Automattic team. That will enable you to re-use domains, reserve your custom domains and reserve TCP ports.
If you are an Automattician, sign up on Ngrok.com using your A8C Google account; you'll be automatically added to the Automattic team. That will enable you to re-use domains, reserve your custom domains and reserve TCP ports.

[Go to this page to reserve a permanent domain](https://dashboard.ngrok.com/reserved).

Expand Down Expand Up @@ -355,7 +355,7 @@ You can pass multiple configuration files by adding more `-f/--file` arguments.

### Accessing logs

Logs are stored in your filesystem under `./docker/logs` directory.
Logs are stored in your file system under `./docker/logs` directory.

#### PHP error log

Expand Down Expand Up @@ -388,7 +388,7 @@ You’ll need to install the [php-debug](https://atom.io/packages/php-debug) pac
* Add Breakpoints
* Step through debugging (Over, In, Out)
* Stack and Context views
* Add Watchpoints to inspect current values of variables
* Add watch points to inspect current values of variables

##### Configuring Atom editor

Expand All @@ -399,7 +399,7 @@ You’ll need to install the [php-debug](https://atom.io/packages/php-debug) pac
1. To listen on all addresses (**Server Address**: `0.0.0.0`)
![Screenshot showing "Server Address" input](https://user-images.githubusercontent.com/746152/37093338-c381757e-21ed-11e8-92cd-5b947a2d35ba.png)

2. To map your current Jetpack directory to the docker filesystem path (**Path Maps** to `/var/www/html/wp-content/plugins/jetpack;/local-path-in-your-computer/jetpack`)
2. To map your current Jetpack directory to the docker file system path (**Path Maps** to `/var/www/html/wp-content/plugins/jetpack;/local-path-in-your-computer/jetpack`)

![Screenshot showing "Path Maps" input](https://user-images.githubusercontent.com/746152/37150779-c891a7f4-22b1-11e8-9293-f34679df82f5.png)

Expand All @@ -421,7 +421,7 @@ You’ll need to install the [php-debug](https://atom.io/packages/php-debug) pac

![Screenshot showing debugger console](https://user-images.githubusercontent.com/746152/37092608-3f649e26-21eb-11e8-87b8-02a8ae7e9a98.png)

* This window will read `Listening on address port 0.0.0.0:9000` until you go to the WordPress site and refresh to make a new request. Then this window will read: `Connected` for a short time until the request ends. Note that it will also remain as such if you had added a breakpoint and the code flow has stopped:
* This window will read `Listening on address port 0.0.0.0:9000` until you go to the WordPress site and refresh to make a new request. Then this window will read: `Connected` for a short time until the request ends. Note that it will also remain as such if you had added a break point and the code flow has stopped:

![Screenshot showing "connected"](https://user-images.githubusercontent.com/746152/37092711-9d8d1fb4-21eb-11e8-93f6-dd1edf89e6fa.png)

Expand Down Expand Up @@ -449,7 +449,7 @@ Below are instructions for starting a debug session in PhpStorm that will listen

1. In the server configuration window, set your host to the URL you use to run Jetpack locally. ( Eg, localhost, or 0.0.0.0, or example.ngrok.io )

1. In the server configuration window, check the 'Use path mappings' checkbox.
1. In the server configuration window, check the 'Use path mappings' check box.

1. In the server configuration window, map the main Jetpack folder to '/var/www/html/wp-content/plugins/jetpack' and map '/docker/wordpress' to '/var/www'

Expand Down Expand Up @@ -514,7 +514,7 @@ Now, in your browser's Xdebug Helper preferences, look for the IDE Key setting:

##### Run the debugger

- Set a breakpoint in a php file, for example in the `init()` function of `class.jetpack.php`.
- Set a break point in a PHP file, for example in the `init()` function of `class.jetpack.php`.
- Select 'Debug' on the browser extension.
- Click 'play' in VSCode's debug panel
- Refresh the page at localhost
Expand Down
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Once your development environment is ready, you can get started and [create your

If you'd like to contribute but don't know where to get started, you can take a look at existing issues:

- ["Good First Bug"](https://github.com/Automattic/jetpack/labels/%5BType%5D%20Good%20First%20Bug) issues are a good entry point to get familiar with Jetpack's codebase.
- ["Good First Bug"](https://github.com/Automattic/jetpack/labels/%5BType%5D%20Good%20First%20Bug) issues are a good entry point to get familiar with Jetpack's code base.
- All issues labeled with [the "Good For Community" label](https://github.com/Automattic/Jetpack/issues?q=is%3Aopen+is%3Aissue+label%3A%22%5BType%5D+Good+For+Community%22) are fair game. That's a great way to contribute new features and fix small issues within Jetpack.

### We’re Here To Help
Expand Down
2 changes: 1 addition & 1 deletion docs/development-environment-cli-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ This command is essential for running the Jetpack Docker Development Environment

### Command is available: docker-compose

The command `docker-compose` comes with the Docker app in most environments nowawadays but it wasn not the case with old versions of the Docker app.
The command `docker-compose` comes with the Docker app in most environments nowadays but it was not the case with old versions of the Docker app.

This command is needed for leveraging the multiple docker containers that encompass the Jetpack Docker Development Environment.

Expand Down
16 changes: 8 additions & 8 deletions docs/development-environment.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Development Environment

The javascript and CSS components of this plugin's admin interface need to be built in order to get the runtime bundle (`_inc/build/admin.js`)
The JavaScript and CSS components of this plugin's admin interface need to be built in order to get the run time bundle (`_inc/build/admin.js`)

## Before moving forward

Expand Down Expand Up @@ -45,7 +45,7 @@ $ yarn distclean
$ git clone [email protected]:Automattic/jetpack.git
$ cd jetpack
```
You'll need to have a public SSH key setup with Github, which is more secure than saving your password in yor keychain.
You'll need to have a public SSH key setup with GitHub, which is more secure than saving your password in your keychain.
There are more details about [setting up a public key on GitHub.com](https://help.github.com/en/articles/adding-a-new-ssh-key-to-your-github-account).

3. [Install Composer](#installing-composer).
Expand All @@ -63,7 +63,7 @@ $ yarn distclean

## Development build

The development build will create a build without minifying or deduping code. It will also install dependencies for you, so you don't need to `yarn` before it.
The development build will create a build without minifying or de-duping code. It will also install dependencies for you, so you don't need to `yarn` before it.

```
$ yarn build
Expand All @@ -72,15 +72,15 @@ $ yarn build
## Development build with changes monitoring (watch)

You can run a watch process, which will continuously watch the front-end JS and CSS/Sass for changes and rebuild accordingly.
Instead of `yarn build` you'd use `yarn watch`. `yarn watch` will fully build Jetpack and update the React-powered admin and CSS/Saas.
Instead of `yarn build` you'd use `yarn watch`. `yarn watch` will fully build Jetpack and update the React-powered admin and CSS/SASS.

```
$ yarn watch
```

## Production build

The production build will generate minified files without duplicated code (resulting from dependencies) and will also generate the matching sourcemap and language files.
The production build will generate minified files without duplicated code (resulting from dependencies) and will also generate the matching source map and language files.

```
$ NODE_ENV=production yarn build-client
Expand All @@ -104,7 +104,7 @@ Set the database information for your testing DB in the file `/tmp/wordpress-dev

To run tests on your machine, you can run `phpunit` while in the Jetpack directory.

To run Woocommerce integration tests, you'll need the woocommerce plugin installed alongside Jetpack (in `../woocommerce`), and you can run:
To run WooCommerce integration tests, you'll need the WooCommerce plugin installed alongside Jetpack (in `../woocommerce`), and you can run:

```
JETPACK_TEST_WOOCOMMERCE=1 phpunit
Expand Down Expand Up @@ -234,7 +234,7 @@ $ yarn php:compatibility .

`yarn lint` will check syntax and style in the following JavaScript pieces:

* All the frontend JavaScript that Jetpack relies on.
* All the front end JavaScript that Jetpack relies on.
* All the JavaScript present in the Admin Page Single Page App for Jetpack.

```sh
Expand Down Expand Up @@ -265,7 +265,7 @@ By default, WordPress loads minified versions of Jetpack's JS files. If you want

### WP-CLI

Jetpack CLI is a command line interface for Jetpack, extending off of wp-cli for WordPress. You can easily modify your installation of Jetpack with a just a few simple commands. All you need is SSH access and a basic understanding of command line tools.
Jetpack CLI is a command line interface for Jetpack, extending off of WP-CLI for WordPress. You can easily modify your installation of Jetpack with a just a few simple commands. All you need is SSH access and a basic understanding of command line tools.

Usage:

Expand Down
2 changes: 1 addition & 1 deletion docs/pull-request.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Lifecycle of a Pull Request
# Life Cycle of a Pull Request

When you’re first starting out, your natural instinct when creating a new feature will be to create a local feature branch, and start building away. If you start doing this, *stop*, take your hands off the keyboard, grab a coffee and read on. :)

Expand Down
6 changes: 3 additions & 3 deletions docs/rest-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ Accepts a JSON object in the body like:
}
```

POSTing with `isActive` as `false` will disconect the site. Sending `isActive: true` has no effect.
POSTing with `isActive` as `false` will disconnect the site. Sending `isActive: true` has no effect.

#### POST /wp-json/jetpack/v4/connection/user

Expand All @@ -280,14 +280,14 @@ Accepts a JSON object in the body like:
}
```

POSTing with `linked` as `false` will disconect the site. Sending `linked: true` has no effect.
POSTing with `linked` as `false` will disconnect the site. Sending `linked: true` has no effect.


### Jetpack modules

#### GET /wp-json/jetpack/v4/module/all

Get a list of all Jetpacks modules, its description, other properties and the module's options
Get a list of all Jetpack's modules, its description, other properties and the module's options

**Note**. The response has a big payload in the body. Use it carefully.

Expand Down
2 changes: 1 addition & 1 deletion extensions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Generally, all new extensions should start out as a beta.

- Before you develop, remember to add your extension's slug to the beta array in `extensions/index.json`.
- In the `wp-config.php` for your Docker environment (`docker/wordpress/wp-config.php`) or in your custom mu-plugins file (`docker/mu-plugins/yourfile.php`), enable beta extensions with the following snippet: `define( 'JETPACK_BETA_BLOCKS', true );`
- In the WordPress.com environment, a12s will be able to see beta extensions with no further configuration
- In the WordPress.com environment, Automatticians will be able to see beta extensions with no further configuration
- Once you've successfully beta tested your new extension, you can open new PR to make your extension live!
- Simply move the extension's slug out of the beta array and into the production array in `extensions/index.json`.

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"test-encrypt-config": "openssl enc -md sha1 -aes-256-cbc -pass env:CONFIG_KEY -in ./tests/e2e/config/local-test.js -out ./tests/e2e/config/encrypted.enc",
"test-extensions": "jest",
"test-e2e": "NODE_CONFIG_DIR='./tests/e2e/config' NODE_CONFIG_ENV=test JEST_PUPPETEER_CONFIG=tests/e2e/jest-puppeteer.config.js jest --config tests/e2e/jest.config.js",
"test-spelling": "mdspell -n -a -x --en-us **/*.md",
"add-textdomain": "wpi18n addtextdomain --textdomain=jetpack --glob-pattern='!(docker|node_modules|tests|tools|vendor){*.php,**/*.php}'",
"test-gui": "NODE_ENV=test NODE_PATH=tests:_inc/client tests/runner.js gui",
"test-modules": "NODE_ENV=test NODE_PATH=tests:_inc/client tests/runner.js modules",
Expand Down Expand Up @@ -192,6 +193,7 @@
"jest": "24.9.0",
"jest-puppeteer": "4.3.0",
"lodash": "4.17.15",
"markdown-spellcheck": "1.3.1",
"mocha": "6.2.2",
"mockery": "2.1.0",
"nock": "10.0.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Jetpack packages for Development

These Composer packages offer a unified codebase that we will share among projects under the Jetpack brand.
These Composer packages offer a unified code base that we will share among projects under the Jetpack brand.

## Installing Composer

Expand Down
Loading

0 comments on commit b7229b4

Please sign in to comment.