Skip to content

Commit e09580f

Browse files
authored
Combine develop and trunk
2 parents 2b15da7 + 45a5081 commit e09580f

File tree

95 files changed

+13232
-595
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+13232
-595
lines changed

.docker/config/certs/localhost.crt

Lines changed: 0 additions & 17 deletions
This file was deleted.

.docker/config/certs/localhost.key

Lines changed: 0 additions & 15 deletions
This file was deleted.

.docker/config/db/my.cnf

Lines changed: 0 additions & 12 deletions
This file was deleted.

.docker/config/nginx/default.conf

Lines changed: 0 additions & 45 deletions
This file was deleted.

.docker/config/php-fpm/php.ini

Lines changed: 0 additions & 11 deletions
This file was deleted.

.editorconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This file is for unifying the coding style for different editors and IDEs
2+
# editorconfig.org
3+
4+
# WordPress Coding Standards
5+
# https://make.wordpress.org/core/handbook/coding-standards/
6+
7+
root = true
8+
9+
[*]
10+
charset = utf-8
11+
end_of_line = lf
12+
insert_final_newline = true
13+
trim_trailing_whitespace = true
14+
indent_style = tab
15+
16+
[*.yml]
17+
indent_style = space
18+
indent_size = 2
19+
20+
[*.md]
21+
trim_trailing_whitespace = false
22+
23+
[{*.txt,wp-config-sample.php}]
24+
end_of_line = crlf

.eslintrc.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,10 @@ module.exports = {
33
"extends": [
44
"plugin:@wordpress/eslint-plugin/esnext"
55
],
6-
overrides: [
7-
{
8-
files: [ 'assets/javascript/**/*.js' ],
9-
globals: {
10-
jQuery: true,
11-
document: true,
12-
window: true,
13-
wp: true,
14-
}
15-
}
16-
]
17-
};
6+
globals: {
7+
jQuery: true,
8+
document: true,
9+
window: true,
10+
wp: true,
11+
}
12+
};

.github/CONTRIBUTING.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,27 @@ this kind of valuable input.
1818

1919

2020
## Contributing with documentation
21-
The directory `docs` has our plugins readme, changelog and handbook content.
21+
The directory `docs` has any documentation that for the plugin which will be included in a release, such as the readme and changelog.
22+
23+
Plugin assets, like screenshots and similar are found in the `assets` directory.
2224

2325
The handbook lives on the WordPress.org Support Team's site, at https://make.wordpress.org/support/handbook/appendix/troubleshooting-using-the-health-check/.
24-
The structure of this document will be replicated to the website, and allows us to educate users and
25-
developers on the benefits of the plugin and how to use it.
2626

2727

2828
## Contributing with code
2929

30-
When contributing through code, please make sure each feature is developed as a separate, forked, branch of `develop`.
31-
32-
The `master` branch of the repository is kept in a stable state, and should at any given time always be the most recent public release of the plugin.
30+
When contributing through code, please make sure each feature is developed as a separate, forked, branch of `trunk`.
3331

34-
By splitting them up, we are able to make point releases without affecting already developed features intended for future major versions.
32+
The `trunk` branch is the most recent beta of the plugin at any given time, stable releases of the plugin may be downloaded from the [GitHub releases page](https://github.com/WordPress/health-check/releases), or from the [WordPress.org plugins page](https://wordpress.org/plugins/health-check/).
3533

3634
You do not need a local development environment set up to make code changes, although it is useful
3735
when making changes to JavaScript or SASS (CSS styles) as these are concatenated by our build tools,
3836
and are only provided in raw form in the repository.
3937

40-
The project has 4 primary directories:
41-
- `assets`, which holds JavaScript and SASS files.
42-
- `bin`, which holds a shellscript to install the framework for running unit tests.
38+
The project has 3 primary directories:
4339
- `src`, which contains general source files for the project.
44-
- `tests`, where unit tests are created.
40+
- `tests`, where unit tests are created.
41+
- `docs`, which houses the plugin readme, its changelog, and potentially any other documentation which may prove valuable.
4542

4643
Please do not change version numbers in when providing code changes, these are bumped by the project
4744
maintainers when a new version is released, and any changes outside of this may lead to confusion.
@@ -50,30 +47,32 @@ maintainers when a new version is released, and any changes outside of this may
5047
### Setting up a local environment
5148

5249
If you wish to set up a local environment for working with the project, start off by installing
53-
[node](https://nodejs.org), [npm](https://www.npmjs.com) (Node Package Manager)
50+
[node](https://nodejs.org), [npm](https://www.npmjs.com) (Node Package Manager) or [yarn](https://yarnpkg.com/),
5451
and [composer](https://getcomposer.org).
5552

53+
This project favors yarn, but you may substitute `yarn` for `npm` in the commands below during your local development if you are more comfortable doing so.
54+
5655
Once these are installed, you will want to open the command line in the project directory and
5756
execute the following commands:
5857
- `composer install` This will install composer dependencies, as defined in the `composer.json` file.
59-
- `npm install` This will install node modules that we use, as defined in the `package.json` file.
58+
- `yarn install` This will install node modules that we use, as defined in the `package.json` file.
59+
- `yarn run build` creates the `health-check` directory with all files for a finished plugin.
6060

6161
#### Docker setup
62-
To make it easier to test your code on the go, a [Docker](https://www.docker.com/) configuration is prepared for you.
63-
Just run `docker-compose up` and wait for things to finish setting up. Once setup is complete, the following tools are available:
64-
- `http://health-check.localhost` the main WordPress site install
65-
- `http://health-check.localhost:8080` Adminer, a lightweight SQL editor
66-
- `http://health-check.localhost:8025` MailHog, captures emails so you don't need ot worry about spamming inboxes during testing.
67-
68-
The Health Check plugin will also be automatically added to the test site, although deactivated initially. Running the `grunt watch` task during development also guarantees your test site is always showing your latest changes.
62+
This project uses [wp-env](https://developer.wordpress.org/block-editor/packages/packages-env/) for it's Docker setup.
6963

64+
Once you have built the project, you may use the `yarn run wp-env start` command to test your code.
65+
66+
The `yarn run wp-env` command is a placeholder, and you may pass any command that `wp-env` supports to it.
67+
68+
For convenience sake, you may also run `yarn run watch` to automatically build any changes you make to the code during development.
69+
7070
### Submitting Pull Requests
7171

7272
Once you've got your development environment set up, and you are ready to push your code, here
7373
are some items you should take note of
7474
- Does the code follow the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/)?
7575
- Did you include unit tests (if applicable)?
76-
- Was your local copy recently pulled from `master`, so it's a clean patch?
7776

7877
When pushing, you should use a branch name that is short and describes what your code does.
7978
For example, if your code adds a feature for showing colors, naming it `feature-show-colors` makes

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
## Short introduction
2-
- What ticket is the PR related to.
3-
- What is the gist of the solution.
2+
- What ticket, if any, is this pull request related to.
3+
- Give a short summary of the problem you are trying to solve.
44

55

66
## Description of what the PR accomplishes
7-
- A more thorough description of what problem the PR addresses and how.
7+
- A more thorough description of what problem the PR addresses and how the changes improve on them.
88

99

1010
## Screenshots
1111
- If the changes included are visual, always include screenshots or screen casts, preferably showing both before and after.
12-
13-
14-
## PR Checklist
15-
These are things to ensure are covered by your PR.
16-
- [ ] This PR is created against the `develop` branch
17-
- [ ] This PR is feature ready and can be reviewed in its entirety
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: Coding Standards
2+
3+
on:
4+
push:
5+
branches:
6+
- trunk
7+
pull_request:
8+
9+
jobs:
10+
# Runs PHP coding standards checks.
11+
#
12+
# Violations are reported inline with annotations.
13+
#
14+
# Performs the following steps:
15+
# - Checks out the repository.
16+
# - Sets up PHP.
17+
# - Logs debug information.
18+
# - Installs Composer dependencies (use cache if possible).
19+
# - Make Composer packages available globally.
20+
# - Logs PHP_CodeSniffer debug information.
21+
# - Runs PHPCS on the full codebase with warnings suppressed.
22+
phpcs:
23+
name: PHP coding standards
24+
runs-on: ubuntu-latest
25+
if: ${{ github.repository == 'WordPress/health-check' || github.event_name == 'pull_request' }}
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v2
30+
31+
- name: Set up PHP
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: '7.4'
35+
coverage: none
36+
tools: composer, cs2pr
37+
38+
- name: Log debug information
39+
run: |
40+
php --version
41+
composer --version
42+
43+
- name: Install Composer dependencies
44+
uses: ramsey/composer-install@v1
45+
with:
46+
composer-options: "--no-progress --no-ansi --no-interaction"
47+
48+
- name: Make Composer packages available globally
49+
run: echo "${PWD}/vendor/bin" >> $GITHUB_PATH
50+
51+
- name: Log PHPCS debug information
52+
run: phpcs -i
53+
54+
- name: Run PHPCS on all Core files
55+
run: phpcs -q -n --report=checkstyle | cs2pr
56+
57+
- name: Check test suite files for warnings
58+
run: phpcs tests -q --report=checkstyle | cs2pr
59+
60+
# Runs the JavaScript and CSS coding standards checks.
61+
#
62+
# Performs the following steps:
63+
# - Checks out the repository.
64+
# - Logs debug information about the runner container.
65+
# - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches)
66+
# - Sets up caching for NPM.
67+
# - Logs updated debug information.
68+
# _ Installs dependencies.
69+
# - Run the ESLint checks.
70+
# - Run the StyleLint checks.
71+
eslint:
72+
name: JavaScript and CSS style linters
73+
runs-on: ubuntu-latest
74+
if: ${{ github.repository == 'WordPress/health-check' || github.event_name == 'pull_request' }}
75+
env:
76+
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }}
77+
78+
steps:
79+
- name: Checkout repository
80+
uses: actions/checkout@v2
81+
82+
- name: Log debug information
83+
run: |
84+
yarn --version
85+
node --version
86+
git --version
87+
svn --version
88+
89+
- name: Install NodeJS
90+
uses: actions/setup-node@v1
91+
with:
92+
node-version: 12
93+
94+
- name: Cache NodeJS modules
95+
uses: actions/cache@v2
96+
env:
97+
cache-name: cache-node-modules
98+
with:
99+
# npm cache files are stored in `~/.npm` on Linux/macOS
100+
path: ~/.npm
101+
key: ${{ runner.os }}-npm-${{ hashFiles('**/yarn.lock') }}
102+
restore-keys: |
103+
${{ runner.os }}-npm-
104+
105+
- name: Log debug information
106+
run: |
107+
yarn --version
108+
node --version
109+
110+
- name: Install Dependencies
111+
run: yarn install
112+
113+
- name: Run ESLint
114+
run: yarn run lint:js
115+
116+
- name: Run StyleLint
117+
run: yarn run lint:css

0 commit comments

Comments
 (0)