-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
374 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# This file is for unifying the coding style for different editors and IDEs | ||
# editorconfig.org | ||
|
||
# WordPress Coding Standards | ||
# http://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 | ||
|
||
[*.json] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.md] | ||
indent_style = space | ||
|
||
[*.txt,wp-config-sample.php] | ||
end_of_line = crlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="WordPress-Timber"> | ||
<description>A custom set of rules to check coding standards for Timber.</description> | ||
|
||
<!-- | ||
Default settings for command line usage | ||
--> | ||
|
||
<!-- Exclude folders and files from being checked. --> | ||
<exclude-pattern>*/tests/*</exclude-pattern> | ||
<exclude-pattern>*.twig</exclude-pattern> | ||
|
||
<!-- If no files or directories are specified on the command line, check all relevant files. --> | ||
<file>./lib</file> | ||
|
||
<!-- Use colors in output. --> | ||
<arg name="colors"/> | ||
|
||
<!-- Show sniff names and progress. --> | ||
<arg value="sp"/> | ||
|
||
<!-- | ||
WordPress-Extra | ||
Best practices beyond core WordPress Coding Standards. | ||
The WordPress-Core standard doesn’t have to be included here, | ||
because WordPress-Extra already includes it. | ||
--> | ||
<rule ref="WordPress-Extra"> | ||
<!-- Do not check for proper WordPress file names. --> | ||
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" /> | ||
</rule> | ||
|
||
<!-- | ||
WordPress-Docs | ||
WordPress Coding Standards for Inline Documentation and Comments. | ||
--> | ||
<rule ref="WordPress-Docs" /> | ||
|
||
<!-- | ||
File Names | ||
The WordPress Coding Standards state that all class files should start with 'class-'. Timber | ||
follows the PSR-0 standard for naming class files, because it uses autoloading via Composer. | ||
@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#disregard-class-file-name-rules | ||
--> | ||
<rule ref="WordPress.Files.FileName"> | ||
<properties> | ||
<property name="strict_class_file_names" value="false" /> | ||
</properties> | ||
</rule> | ||
|
||
<!-- | ||
Line length | ||
Lines should be 100 chars long at max (triggers warning), | ||
and should in no case exceed 120 characters (triggers error). | ||
--> | ||
<rule ref="Generic.Files.LineLength"> | ||
<properties> | ||
<property name="lineLimit" value="100"/> | ||
<property name="absoluteLineLimit" value="120"/> | ||
</properties> | ||
</rule> | ||
|
||
<!-- | ||
Hook Names | ||
While the WordPress Coding Standards state that hook names should be separated by | ||
underscores, an optionated approach used by plugins like Advanced Custom Fields is to use | ||
'/' to namespace hooks. | ||
@link https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#custom-word-delimiters-in-hook-names | ||
--> | ||
<rule ref="WordPress.NamingConventions.ValidHookName"> | ||
<properties> | ||
<property name="additionalWordDelimiters" value="/"/> | ||
</properties> | ||
</rule> | ||
</ruleset> |
Oops, something went wrong.