Skip to content

Commit f2e2bab

Browse files
authored
Keep .editorconfig in sync with .prettierrc.js (#1708)
1 parent f609661 commit f2e2bab

File tree

8 files changed

+182
-190
lines changed

8 files changed

+182
-190
lines changed

.distignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
.github
88
.gitignore
99
.php_cs
10+
.prettierignore
11+
.prettierrc.js
1012
.svnignore
1113
.travis.yml
1214
.wordpress-org

.editorconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# This file is for unifying the coding style for different editors and IDEs
22
# editorconfig.org
3-
3+
#
44
# WordPress Coding Standards
55
# https://make.wordpress.org/core/handbook/coding-standards/
6+
#
7+
# Be sure to keep this file in sync with the .prettierrc.js file.
68

79
root = true
810

.prettierrc.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,12 @@ module.exports = {
55

66
printWidth: 120,
77
overrides: [
8-
{
9-
files: '*.json',
10-
options: {
11-
useTabs: false,
12-
},
13-
},
148
{
159
files: '*.yml',
1610
options: {
1711
useTabs: false,
1812
tabWidth: 2,
1913
},
2014
},
21-
{
22-
files: '*.md',
23-
options: {
24-
trimTrailingWhitespace: false, // Not a valid Prettier option, handled by editorconfig only
25-
},
26-
},
2715
],
2816
};
Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
{
2-
"landingPage": "/wp-admin/options-general.php?page=activitypub",
3-
"steps": [
4-
{
5-
"step": "setSiteOptions",
6-
"options": {
7-
"permalink_structure": "/%postname%/"
8-
}
9-
},
10-
{
11-
"step": "installPlugin",
12-
"pluginZipFile": {
13-
"resource": "wordpress.org/plugins",
14-
"slug": "activitypub"
15-
},
16-
"options": {
17-
"activate": true
18-
}
19-
},
20-
{
21-
"step": "login",
22-
"username": "admin",
23-
"password": "password"
24-
},
25-
{
26-
"step": "mkdir",
27-
"path": "wordpress/wp-content/mu-plugins"
28-
},
29-
{
30-
"step": "writeFile",
31-
"path": "wordpress/wp-content/mu-plugins/show-admin-notice-2.php",
32-
"data": "<?php\nadd_action(\n'admin_notices',\nfunction() {\n$dismissed = get_user_option( 'dismissed_expose_blueprint_notice-2', get_current_user_id() );\nif ( $dismissed ) {\nreturn;\n}\necho '<div class=\"notice notice-info is-dismissible\" id=\"custom-admin-notice-2\"><p>' . esc_html( 'Welcome and have fun 👋' ) . '</p></div>';\n}\n);\nadd_action('wp_ajax_dismiss_custom-admin-notice-2', function() {\ncheck_ajax_referer('custom-admin-notice-2', 'nonce');\n$user_id = get_current_user_id();\nif ( $user_id ) {\nupdate_user_option($user_id, 'dismissed_expose_blueprint_notice-2', 1, false);\nwp_send_json_success();\n} else {\nwp_send_json_error('User not found');\n}\n} );\nadd_action('admin_footer', function() {\n?>\n<script type=\"text/javascript\">\njQuery(document).ready( function($) {\nvar ajaxurl = '<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>';\nvar nonce = '<?php echo esc_html( wp_create_nonce( 'custom-admin-notice-2' ) ); ?>';\n$( '#custom-admin-notice-2' ).on( 'click', '.notice-dismiss', function() {\n$.ajax({\nurl: ajaxurl,\ntype: 'POST',\ndata: {\naction: 'dismiss_custom-admin-notice-2',\nnonce: nonce\n}\n});\n});\n});\n</script>\n<?php\n} );"
33-
},
34-
{
35-
"step": "setSiteOptions",
36-
"options": {
37-
"blogname": "ActivityPub Demo",
38-
"blogdescription": "Democratize Publishing in the Fediverse",
39-
"activitypub_enable_blog_user": "1"
40-
}
41-
}
42-
]
2+
"landingPage": "/wp-admin/options-general.php?page=activitypub",
3+
"steps": [
4+
{
5+
"step": "setSiteOptions",
6+
"options": {
7+
"permalink_structure": "/%postname%/"
8+
}
9+
},
10+
{
11+
"step": "installPlugin",
12+
"pluginZipFile": {
13+
"resource": "wordpress.org/plugins",
14+
"slug": "activitypub"
15+
},
16+
"options": {
17+
"activate": true
18+
}
19+
},
20+
{
21+
"step": "login",
22+
"username": "admin",
23+
"password": "password"
24+
},
25+
{
26+
"step": "mkdir",
27+
"path": "wordpress/wp-content/mu-plugins"
28+
},
29+
{
30+
"step": "writeFile",
31+
"path": "wordpress/wp-content/mu-plugins/show-admin-notice-2.php",
32+
"data": "<?php\nadd_action(\n'admin_notices',\nfunction() {\n$dismissed = get_user_option( 'dismissed_expose_blueprint_notice-2', get_current_user_id() );\nif ( $dismissed ) {\nreturn;\n}\necho '<div class=\"notice notice-info is-dismissible\" id=\"custom-admin-notice-2\"><p>' . esc_html( 'Welcome and have fun 👋' ) . '</p></div>';\n}\n);\nadd_action('wp_ajax_dismiss_custom-admin-notice-2', function() {\ncheck_ajax_referer('custom-admin-notice-2', 'nonce');\n$user_id = get_current_user_id();\nif ( $user_id ) {\nupdate_user_option($user_id, 'dismissed_expose_blueprint_notice-2', 1, false);\nwp_send_json_success();\n} else {\nwp_send_json_error('User not found');\n}\n} );\nadd_action('admin_footer', function() {\n?>\n<script type=\"text/javascript\">\njQuery(document).ready( function($) {\nvar ajaxurl = '<?php echo esc_url( admin_url( 'admin-ajax.php' ) ); ?>';\nvar nonce = '<?php echo esc_html( wp_create_nonce( 'custom-admin-notice-2' ) ); ?>';\n$( '#custom-admin-notice-2' ).on( 'click', '.notice-dismiss', function() {\n$.ajax({\nurl: ajaxurl,\ntype: 'POST',\ndata: {\naction: 'dismiss_custom-admin-notice-2',\nnonce: nonce\n}\n});\n});\n});\n</script>\n<?php\n} );"
33+
},
34+
{
35+
"step": "setSiteOptions",
36+
"options": {
37+
"blogname": "ActivityPub Demo",
38+
"blogdescription": "Democratize Publishing in the Fediverse",
39+
"activitypub_enable_blog_user": "1"
40+
}
41+
}
42+
]
4343
}

.wp-env.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"core": null,
3-
"plugins": [ "." ],
4-
"env": {
5-
"tests": {
6-
"config": {
7-
"WP_TESTS_DOMAIN": "example.org",
8-
"WP_SITEURL": "http://example.org",
9-
"WP_HOME": "http://example.org"
10-
},
11-
"port": 80,
12-
"mappings": {
13-
"wp-content/plugins/activitypub": ".",
14-
"wp-content/plugins/activitypub/tests": "./tests",
15-
"wp-content/plugins/activitypub/coverage": "./coverage"
16-
}
17-
}
18-
}
2+
"core": null,
3+
"plugins": [ "." ],
4+
"env": {
5+
"tests": {
6+
"config": {
7+
"WP_TESTS_DOMAIN": "example.org",
8+
"WP_SITEURL": "http://example.org",
9+
"WP_HOME": "http://example.org"
10+
},
11+
"port": 80,
12+
"mappings": {
13+
"wp-content/plugins/activitypub": ".",
14+
"wp-content/plugins/activitypub/tests": "./tests",
15+
"wp-content/plugins/activitypub/coverage": "./coverage"
16+
}
17+
}
18+
}
1919
}

composer.json

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,66 @@
11
{
2-
"name": "pfefferle/wordpress-activitypub",
3-
"description": "The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.",
4-
"type": "wordpress-plugin",
5-
"require": {
6-
"php": ">=7.2",
7-
"composer/installers": "^1.0 || ^2.0"
8-
},
9-
"require-dev": {
10-
"automattic/jetpack-changelogger": "6.0.0",
11-
"phpunit/phpunit": "^8 || ^9",
12-
"phpcompatibility/php-compatibility": "*",
13-
"phpcompatibility/phpcompatibility-wp": "*",
14-
"squizlabs/php_codesniffer": "3.*",
15-
"wp-coding-standards/wpcs": "dev-develop",
16-
"yoast/phpunit-polyfills": "^4.0",
17-
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
18-
"sirbrillig/phpcs-variable-analysis": "^2.11",
19-
"phpcsstandards/phpcsextra": "^1.1.0",
20-
"dms/phpunit-arraysubset-asserts": "^0.5.0"
21-
},
22-
"config": {
23-
"allow-plugins": true
24-
},
25-
"allow-plugins": {
26-
"composer/installers": true
27-
},
28-
"license": "MIT",
29-
"authors": [
30-
{
31-
"name": "Matthias Pfefferle",
32-
"email": "[email protected]"
33-
}
34-
],
35-
"extra": {
36-
"installer-name": "activitypub",
37-
"changelogger": {
38-
"changes-dir": ".github/changelog/",
39-
"link-template": "https://github.com/Automattic/wordpress-activitypub/compare/${old}...${new}"
40-
}
41-
},
42-
"scripts": {
43-
"test": [
44-
"composer install",
45-
"bin/install-wp-tests.sh activitypub-test root activitypub-test test-db latest true",
46-
"vendor/bin/phpunit"
47-
],
48-
"test:wp-env": [
49-
"wp-env run tests-cli --env-cwd=\"wp-content/plugins/activitypub\" vendor/bin/phpunit"
50-
],
51-
"lint": [
52-
"vendor/bin/phpcs"
53-
],
54-
"lint:fix": [
55-
"vendor/bin/phpcbf"
56-
],
57-
"changelog:add": [
58-
"composer install",
59-
"vendor/bin/changelogger add"
60-
],
61-
"changelog:write": [
62-
"composer install",
63-
"vendor/bin/changelogger write --add-pr-num"
64-
]
65-
}
2+
"name": "pfefferle/wordpress-activitypub",
3+
"description": "The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.",
4+
"type": "wordpress-plugin",
5+
"require": {
6+
"php": ">=7.2",
7+
"composer/installers": "^1.0 || ^2.0"
8+
},
9+
"require-dev": {
10+
"automattic/jetpack-changelogger": "6.0.0",
11+
"phpunit/phpunit": "^8 || ^9",
12+
"phpcompatibility/php-compatibility": "*",
13+
"phpcompatibility/phpcompatibility-wp": "*",
14+
"squizlabs/php_codesniffer": "3.*",
15+
"wp-coding-standards/wpcs": "dev-develop",
16+
"yoast/phpunit-polyfills": "^4.0",
17+
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
18+
"sirbrillig/phpcs-variable-analysis": "^2.11",
19+
"phpcsstandards/phpcsextra": "^1.1.0",
20+
"dms/phpunit-arraysubset-asserts": "^0.5.0"
21+
},
22+
"config": {
23+
"allow-plugins": true
24+
},
25+
"allow-plugins": {
26+
"composer/installers": true
27+
},
28+
"license": "MIT",
29+
"authors": [
30+
{
31+
"name": "Matthias Pfefferle",
32+
"email": "[email protected]"
33+
}
34+
],
35+
"extra": {
36+
"installer-name": "activitypub",
37+
"changelogger": {
38+
"changes-dir": ".github/changelog/",
39+
"link-template": "https://github.com/Automattic/wordpress-activitypub/compare/${old}...${new}"
40+
}
41+
},
42+
"scripts": {
43+
"test": [
44+
"composer install",
45+
"bin/install-wp-tests.sh activitypub-test root activitypub-test test-db latest true",
46+
"vendor/bin/phpunit"
47+
],
48+
"test:wp-env": [
49+
"wp-env run tests-cli --env-cwd=\"wp-content/plugins/activitypub\" vendor/bin/phpunit"
50+
],
51+
"lint": [
52+
"vendor/bin/phpcs"
53+
],
54+
"lint:fix": [
55+
"vendor/bin/phpcbf"
56+
],
57+
"changelog:add": [
58+
"composer install",
59+
"vendor/bin/changelogger add"
60+
],
61+
"changelog:write": [
62+
"composer install",
63+
"vendor/bin/changelogger write --add-pr-num"
64+
]
65+
}
6666
}

package.json

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
11
{
2-
"name": "wordpress-activitypub",
3-
"description": "The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.",
4-
"repository": {
5-
"type": "git",
6-
"url": "git+https://github.com/automattic/wordpress-activitypub.git"
7-
},
8-
"author": {
9-
"name": "Matthias Pfefferle",
10-
"web": "https://notiz.blog"
11-
},
12-
"scripts": {
13-
"dev": "wp-scripts start",
14-
"build": "wp-scripts format && wp-scripts build",
15-
"format": "wp-scripts format",
16-
"lint:css": "wp-scripts lint-style",
17-
"lint:js": "wp-scripts lint-js",
18-
"env": "wp-env",
19-
"env-start": "wp-env start && wp-env run cli wp rewrite structure '/%year%/%monthnum%/%postname%/'",
20-
"env-stop": "wp-env stop",
21-
"env-test": "wp-env run tests-cli --env-cwd=\"wp-content/plugins/activitypub\" vendor/bin/phpunit",
22-
"release": "node bin/release.js"
23-
},
24-
"license": "MIT",
25-
"bugs": {
26-
"url": "https://github.com/automattic/wordpress-activitypub/issues"
27-
},
28-
"homepage": "https://github.com/automattic/wordpress-activitypub#readme",
29-
"devDependencies": {
30-
"@wordpress/api-fetch": "^7.22.0",
31-
"@wordpress/block-editor": "^14.17.0",
32-
"@wordpress/blocks": "^14.0.0",
33-
"@wordpress/components": "^29.1.1",
34-
"@wordpress/compose": "^7.22.0",
35-
"@wordpress/core-data": "^7.22.0",
36-
"@wordpress/data": "^10.0.0",
37-
"@wordpress/dom-ready": "^4.0.0",
38-
"@wordpress/editor": "^14.22.0",
39-
"@wordpress/element": "^6.0.0",
40-
"@wordpress/env": "^10.10.0",
41-
"@wordpress/i18n": "^5.22.0",
42-
"@wordpress/icons": "^10.10.0",
43-
"@wordpress/plugins": "^7.22.0",
44-
"@wordpress/prettier-config": "^4.23.0",
45-
"@wordpress/primitives": "^4.22.0",
46-
"@wordpress/scripts": "^27.0.0",
47-
"@wordpress/url": "^4.22.0",
48-
"classnames": "^2.3.2",
49-
"prettier": "npm:wp-prettier@^3.0.3"
50-
}
2+
"name": "wordpress-activitypub",
3+
"description": "The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.",
4+
"repository": {
5+
"type": "git",
6+
"url": "git+https://github.com/automattic/wordpress-activitypub.git"
7+
},
8+
"author": {
9+
"name": "Matthias Pfefferle",
10+
"web": "https://notiz.blog"
11+
},
12+
"scripts": {
13+
"dev": "wp-scripts start",
14+
"build": "wp-scripts format && wp-scripts build",
15+
"format": "wp-scripts format",
16+
"lint:css": "wp-scripts lint-style",
17+
"lint:js": "wp-scripts lint-js",
18+
"env": "wp-env",
19+
"env-start": "wp-env start && wp-env run cli wp rewrite structure '/%year%/%monthnum%/%postname%/'",
20+
"env-stop": "wp-env stop",
21+
"env-test": "wp-env run tests-cli --env-cwd=\"wp-content/plugins/activitypub\" vendor/bin/phpunit",
22+
"release": "node bin/release.js"
23+
},
24+
"license": "MIT",
25+
"bugs": {
26+
"url": "https://github.com/automattic/wordpress-activitypub/issues"
27+
},
28+
"homepage": "https://github.com/automattic/wordpress-activitypub#readme",
29+
"devDependencies": {
30+
"@wordpress/api-fetch": "^7.22.0",
31+
"@wordpress/block-editor": "^14.17.0",
32+
"@wordpress/blocks": "^14.0.0",
33+
"@wordpress/components": "^29.1.1",
34+
"@wordpress/compose": "^7.22.0",
35+
"@wordpress/core-data": "^7.22.0",
36+
"@wordpress/data": "^10.0.0",
37+
"@wordpress/dom-ready": "^4.0.0",
38+
"@wordpress/editor": "^14.22.0",
39+
"@wordpress/element": "^6.0.0",
40+
"@wordpress/env": "^10.10.0",
41+
"@wordpress/i18n": "^5.22.0",
42+
"@wordpress/icons": "^10.10.0",
43+
"@wordpress/plugins": "^7.22.0",
44+
"@wordpress/prettier-config": "^4.23.0",
45+
"@wordpress/primitives": "^4.22.0",
46+
"@wordpress/scripts": "^27.0.0",
47+
"@wordpress/url": "^4.22.0",
48+
"classnames": "^2.3.2",
49+
"prettier": "npm:wp-prettier@^3.0.3"
50+
}
5151
}

0 commit comments

Comments
 (0)