Skip to content

Commit

Permalink
➕ ADD: phpcs setup files
Browse files Browse the repository at this point in the history
  • Loading branch information
anantajitjg committed Mar 22, 2019
1 parent 672c5e2 commit 5fcdf40
Show file tree
Hide file tree
Showing 6 changed files with 198 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/

root = true

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

[*.yml]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
.gitignore export-ignore
package.json export-ignore
package-lock.json export-ignore
composer.json export-ignore
composer.lock export-ignore
config.js export-ignore
gulpfile.js export-ignore
phpcs.xml export-ignore
README.md export-ignore
CHANGELOG.md export-ignore
assets/fonts/icomoon.json export-ignore
.editorconfig export-ignore
.prettierrc export-ignore
*.map export-ignore
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ node_modules
build
*.code-workspace
*.zip
*.log
*.log
/vendor/
14 changes: 14 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "awsm/wp-job-openings",
"description": "Super simple Job Listing plugin to manage Job Openings and Applicants on your WordPress site.",
"type": "wordpress-plugin",
"license": "GPL-2.0-or-later",
"require": {
"squizlabs/php_codesniffer": "3.*",
"wp-coding-standards/wpcs": "^2.0"
},
"scripts": {
"phpcs": "phpcs --colors -p -s",
"phpcbf": "phpcbf --colors -p -s"
}
}
114 changes: 114 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0"?>
<ruleset name="WP Job Openings">
<description>WP Job Openings coding standard.</description>

<config name="installed_paths" value="vendor/wp-coding-standards/wpcs" />
<config name="minimum_supported_wp_version" value="4.1" />

<arg name="extensions" value="php" />

<!-- Exclude the Composer Vendor directory. -->
<exclude-pattern>/vendor/*</exclude-pattern>

<!-- Exclude the Node Modules directory. -->
<exclude-pattern>/node_modules/*</exclude-pattern>

<!-- Exclude build directory. -->
<exclude-pattern>/build/*</exclude-pattern>

<!-- Exclude libraries. -->
<exclude-pattern>/lib/*</exclude-pattern>

<rule ref="WordPress-Core" />

<rule ref="WordPress.Files.FileName.InvalidClassFileName">
<exclude-pattern>wp-job-openings.php</exclude-pattern>
</rule>

<rule ref="WordPress-Extra">
<exclude name="WordPress.WhiteSpace.PrecisionAlignment.Found" />
<exclude name="WordPress.PHP.YodaConditions" />
</rule>

<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter" />

<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" type="array">
<element value="default" />
<element value="wp-job-openings" />
</property>
</properties>
</rule>
</ruleset>

0 comments on commit 5fcdf40

Please sign in to comment.