Skip to content

Commit

Permalink
Merge pull request #4 from linchpin/merge/upstream
Browse files Browse the repository at this point in the history
Merge/upstream
  • Loading branch information
aaronware authored Apr 28, 2023
2 parents 96baa13 + a6241a3 commit 04f0837
Show file tree
Hide file tree
Showing 120 changed files with 2,950 additions and 8,710 deletions.
36 changes: 36 additions & 0 deletions .deployment/cleanup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

/**
* This file cleans up some odds and ends things prior to release
*
* @since 1.0.0 Make sure debug config lines are set to false by default
*/

echo "➤ Forcing debug config off\n\r";

// Read the elite plugin file into a string
$elite_plugin_file = file_get_contents('./linchpin-com-functionality.php' );

// Make sure a release does not have hardcoded debug lines set to true.
$configs = [
'ASH_DEBUG',
'ASH_DEV_MODE',
];

$errors_found = 0;

foreach ( $configs as $config ) {
if ( false !== strpos( $elite_plugin_file, "define( '$config', true );" ) ) {
$elite_plugin_file = str_replace( "define( '$config', true );", "define( '$config', false );", $elite_plugin_file );

echo esc_html( "\e[31m➤ Doing it wrong:\e[36m $config \e[0mhas been updated to false, you should set these configs outside the plugin!\n\r" );
$errors_found++;
}
}

if ( empty( $errors_found ) ) {
echo "\e[32m➤ No debug configs found\n\r";
}

// Write our new file.
file_put_contents( './functions.php', $elite_plugin_file );
26 changes: 26 additions & 0 deletions .deployment/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

set -eo

TMP_DIR="$GITHUB_WORKSPACE/zip"
mkdir "$TMP_DIR"

# If there's no .gitattributes file, write a default one into place
if [ ! -e "$GITHUB_WORKSPACE/.distignore" ]; then
echo "ℹ︎ Creating .distignore file"

cat > ".distignore" <<-EOL
/.gitattributes
/.gitignore
/.github
/README.md
/.editorconfig
/composer.json
/index.php
EOL
fi;

echo "➤ Copying files to $TMP_DIR"

# This will exclude everything in the .gitattributes file with the export-ignore flag
rsync -rc --exclude-from="$GITHUB_WORKSPACE/.distignore" "$GITHUB_WORKSPACE/" "$TMP_DIR/" --delete
63 changes: 63 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.babelrc
.browserslistrc
.deployment
.distignore
.DS_Store
.editorconfig
.eslintignore
.git
.gitattributes
.github
.gitignore
.idea
.Trashes
.php-cs-fixer.dist.php
composer.lock
gulp-tasks
phpunit.xml
.phplint.yml
.vipgoci_phpcs_skip_folders
.husky
.npmrc
.release-please-manifest.json
.vipgoci_lint_skip_folders
.vipgoci_phpcs_skip_folders
phpcs.xml
phpdoc.dist.xml
SECURITY.md
yarn.lock
yarn-error.log
webpack.config.babel.js
/wp-components
/output
/sourcedata
/wiki
/composer.json
/index.php
/README.md
bower_components
/node_modules
atlassian-ide-plugin.xml
Desktop.ini
Gruntfile.js
gulpfile.js
gulpfile.babel.js
scss
Thumbs.db
phpDocumentor.phar
auth.json
/zip
blocks/src
blocks/node_modules
commitlint.config.js
docker_tag
Dockerfile-php-build
output.log
release-please-config.json
renovate.json
DOCKER_ENV
/frontend
/dist
package-lock.json
/src
webpack.config.js
9 changes: 0 additions & 9 deletions .gitattributes

This file was deleted.

2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @wpengine/developer-relations
* @linchpin/developer-relations
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/Bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Bug report
description: Report a bug with the Frost or another theme in this repo
description: Report a bug with the MMXXIII
body:
- type: textarea
attributes:
Expand Down Expand Up @@ -34,7 +34,7 @@ body:
attributes:
label: Environment info
description: |
Please list what Frost version you are using. If you are also using a Frost child theme, please note that version as well.
Please list what MMXXIII version you are using. If you are also using a MMXXIII child theme, please note that version as well.
placeholder: |
- WordPress version, Gutenberg version (if active), and active Theme you are using.
- Browser(s) are you seeing the problem on.
Expand All @@ -46,7 +46,7 @@ body:
id: existing
attributes:
label: Please confirm that you have searched existing issues in the repo.
description: You can do this by searching https://github.com/wpengine/themes/issues and making sure the bug is not related to something else.
description: You can do this by searching https://github.com/linchpin/mmxxiii/issues and making sure the bug is not related to something else.
multiple: true
options:
- 'Yes'
Expand Down
16 changes: 0 additions & 16 deletions .github/ISSUE_TEMPLATE/Feature_request.md

This file was deleted.

1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

60 changes: 0 additions & 60 deletions .github/workflows/code-linting.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/phpcbf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
pull_request:
branches: [trunk]
push:
branches: [trunk]

name: WordPress Autofixer

jobs:
phpcbf-fixer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: cs2pr

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
uses: "ramsey/composer-install@v1"

# Check the code-style consistency of the PHP files.
- name: Fix PHP code style
id: codestyle
continue-on-error: true
run: ./vendor/squizlabs/php_codesniffer/bin/phpcbf . --standard=./phpcs.xml

- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GH_BOT_TOKEN }}
commit-message: PHPCBF Auto Fix
committer: Linchpin Bot <[email protected]>
signoff: false
branch: ${{ github.event.pull_request.head.ref }}-phpcbf
delete-branch: true
title: 'Auto Fix Formatting'
body: |
Update Code Formatting
labels: |
phpcs
automated pr
28 changes: 28 additions & 0 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
pull_request:
branches-ignore:
# Do not run on auto submitted branches
- '**-phpcbf'
- 'renovate/'
- 'dependabot/'
paths:
- '**.php'

name: WordPress Coding Standards Inspections

jobs:
runPHPCSInspection:
name: Run PHPCS inspection
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Run PHPCS inspection
uses: rtCamp/[email protected]
env:
GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
SKIP_FOLDERS: ".deployment,.github,assets,.husky,css,js,lib,vendor"
PHPCS_STANDARD_FILE_NAME: "./phpcs.xml"
with:
args: "WordPress,WordPress-Core,WordPress-Extra"
36 changes: 36 additions & 0 deletions .github/workflows/phplint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
on:
pull_request:
branches-ignore:
# Do not run on auto submitted branches
- '**-phpcbf'
- 'renovate/'
- 'dependabot/'
paths:
- '**.php'

name: PHP Lint

jobs:
php-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: cs2pr

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"

- name: PHP Lint
uses: overtrue/[email protected]
with:
path: .
Loading

0 comments on commit 04f0837

Please sign in to comment.