Skip to content

Commit

Permalink
Add basic phpcs and phpunit configs
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinfodness committed Mar 28, 2022
1 parent 23aac0d commit 6602ac6
Show file tree
Hide file tree
Showing 10 changed files with 2,510 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab
indent_size = 4

[*.{json,yaml,yml}]
indent_style = space
indent_size = 2

# Dotfiles
[.*]
indent_style = space
indent_size = 2
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Ignore temporary OS files
.DS_Store
.DS_Store?
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# IDEs
.idea
.vscode

# Composer dependencies
/vendor

# Cache
.phpcs.json
46 changes: 46 additions & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http:https://www.w3.org/2001/XMLSchema-instance" name="Elasticsearch Extensions" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>PHP_CodeSniffer standard for Elasticsearch Extensions.</description>

<!-- Include Alley Rules -->
<rule ref="Alley-Interactive" />

<!-- Set the text domain for i18n. -->
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array" value="elasticsearch-extensions" />
</properties>
</rule>

<!-- Set the prefixes for functions etc. -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<property name="prefixes" type="array" value="elasticsearch_extensions" />
</properties>
</rule>

<!--
Pass some flags to PHPCS:
p flag: Show progress of the run.
s flag: Show sniff codes in all reports.
-->
<arg value="ps" />

<!-- Whenever possible, cache the scan results and re-use those for unchanged files on the next scan. -->
<arg name="cache" value=".phpcs.json" />

<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./" />

<!-- Check up to 20 files simultaneously. -->
<arg name="parallel" value="20" />

<!-- Set severity to 1 to see everything that isn't effectively turned off. -->
<arg name="severity" value="1" />

<!-- Exclude a few directories and autogenerated files. -->
<exclude-pattern>vendor/</exclude-pattern>

<!-- The version set here matches the minimum version tested in buddy.yml. -->
<config name="minimum_supported_wp_version" value="5.9" />
</ruleset>
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Elasticsearch Extensions

A WordPress plugin to make integrating sites with Elasticsearch easier.
Seamlessly and automatically integrates with different Elasticsearch plugins.
Simplifies common Elasticsearch operations like adding faceted search and
filtering indexable post types, taxonomies, and postmeta in an
implementation-agnostic way.

## Supported Adapters

* [VIP Enterprise Search](https://docs.wpvip.com/how-tos/vip-search/)

## Usage

Install and activate the plugin to have it interface with an existing installed
Elasticsearch plugin. This plugin will automatically detect which supported
Elasticsearch plugin is in use, and will register the appropriate hooks.

Customize the Elasticsearch integration using filter hooks in your site's
theme. A full list of available filter hooks is
[available in the wiki](https://github.com/alleyinteractive/elasticsearch-extensions/wiki).
29 changes: 29 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "alleyinteractive/elasticsearch-extensions",
"description": "Elasticsearch Extensions",
"type": "project",
"authors": [
{
"name": "Alley",
"email": "[email protected]"
}
],
"require-dev": {
"alleyinteractive/alley-coding-standards": "^0.3.0",
"phpunit/phpunit": "7.5.*",
"yoast/phpunit-polyfills": "^1.0"
},
"scripts": {
"phpcbf": "phpcbf .",
"phpcs": "phpcs .",
"phpunit": "phpunit",
"setup": [
"composer install"
]
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
Loading

0 comments on commit 6602ac6

Please sign in to comment.