diff --git a/provision/site-cookbooks/wpcli/recipes/install.rb b/provision/site-cookbooks/wpcli/recipes/install.rb index 49f9b96..8b92a4c 100644 --- a/provision/site-cookbooks/wpcli/recipes/install.rb +++ b/provision/site-cookbooks/wpcli/recipes/install.rb @@ -276,3 +276,11 @@ EOH notifies :restart, "service[apache2]" end + +template File.join( node[:wpcli][:wp_docroot], ".editorconfig" ) do + source "editorconfig.erb" + owner node[:wpcli][:user] + group node[:wpcli][:group] + mode "0644" + action :create_if_missing +end diff --git a/provision/site-cookbooks/wpcli/templates/default/editorconfig.erb b/provision/site-cookbooks/wpcli/templates/default/editorconfig.erb new file mode 100644 index 0000000..e1cc194 --- /dev/null +++ b/provision/site-cookbooks/wpcli/templates/default/editorconfig.erb @@ -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 + +[{.jshintrc,*.json,*.yml}] +indent_style = space +indent_size = 2 + +[{*.txt,wp-config-sample.php}] +end_of_line = crlf