Glavin001 / atom-beautify

:mega: Help Wanted - Looking for Maintainer: https://github.com/Glavin001/atom-beautify/issues/2572 | :lipstick: Universal beautification package for Atom editor (:warning: Currently migrating to https://github.com/Unibeautify/ and have very limited bandwidth for Atom-Beautify Issues. Thank you for your patience and understanding :heart: )
http://unibeautify.com/
MIT License
1.5k stars 453 forks source link

Indent html in .php files dont work #720

Closed cleytoncarvalho closed 7 years ago

cleytoncarvalho commented 8 years ago

Indent html code in .php files dont work.

prettydiff commented 8 years ago

Would you mind providing a tiny code example?

canarystudio commented 8 years ago

The mess that is commonly found within Wordpress template files is a good example:

https://gist.github.com/canarystudio/0235180aaa84ae7a70be

Running beautify on this neither re-indents the PHP or HTML (perhaps I'm missing a setting?).

prettydiff commented 8 years ago

Thank you for the code sample. Would you guys mind providing the debug.md file from the Atom Beautify package so that I can see which beautifier is to blame and which options are selected?

canarystudio commented 8 years ago

Is this what you mean? I ran Atom Beautify - Help Debug Editor

Atom Beautify - Debugging information

The following debugging information was generated by Atom Beautify on Tue Mar 08 2016 09:46:10 GMT+1100 (AEDT).


Table Of Contents


Platform: darwin

Versions

Atom Version: 1.5.3

Atom Beautify Version: 0.28.26

Original file to be beautified

Original File Path: /Users/tim/Downloads/wordpress/wp-content/themes/twentysixteen/page.php

Original File Grammar: PHP

Original File Language: PHP

Language namespace: php

Supported Beautifiers: PHP-CS-Fixer, PHPCBF

Selected Beautifier: PHP-CS-Fixer

Original File Contents

<?php
/**
 * The template for displaying pages
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages and that
 * other "pages" on your WordPress site will use a different template.
 *
 * @package WordPress
 * @subpackage Twenty_Sixteen
 * @since Twenty Sixteen 1.0
 */

get_header(); ?>

<div id="primary" class="content-area">
    <main id="main" class="site-main" role="main">
        <?php
        // Start the loop.
        while ( have_posts() ) : the_post();

            // Include the page content template.
            get_template_part( 'template-parts/content', 'page' );

            // If comments are open or we have at least one comment, load up the comment template.
            if ( comments_open() || get_comments_number() ) {
                comments_template();
            }

            // End of the loop.
        endwhile;
        ?>

    </main><!-- .site-main -->

    <?php get_sidebar( 'content-bottom' ); ?>

</div><!-- .content-area -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>

Package Settings

The raw package settings options

{
    "_analyticsUserId": "c5b72db7-9e66-4d2a-b85e-5b0b1b79e5ce",
    "css_force_indentation": true,
    "css_preserve_newlines": true,
    "html_end_with_newline": true,
    "html_indent_inner_html": true,
    "html_wrap_line_length": 90000,
    "analytics": true,
    "_loggerLevel": "warn",
    "beautifyEntireFileOnSave": true,
    "muteUnsupportedLanguageErrors": false,
    "muteAllErrors": false,
    "apex_configPath": "",
    "arduino_configPath": "",
    "cs_configPath": "",
    "c_configPath": "",
    "cfml_indent_inner_html": false,
    "cfml_indent_size": 2,
    "cfml_indent_char": " ",
    "cfml_brace_style": "collapse",
    "cfml_indent_scripts": "normal",
    "cfml_wrap_line_length": 250,
    "cfml_wrap_attributes": "auto",
    "cfml_wrap_attributes_indent_size": 2,
    "cfml_preserve_newlines": true,
    "cfml_max_preserve_newlines": 10,
    "cfml_unformatted": [
        "a",
        "sub",
        "sup",
        "b",
        "i",
        "u"
    ],
    "cfml_end_with_newline": false,
    "cfml_extra_liners": [
        "head",
        "body",
        "/html"
    ],
    "cpp_configPath": "",
    "css_indent_size": 2,
    "css_indent_char": " ",
    "css_selector_separator_newline": false,
    "css_newline_between_rules": false,
    "css_wrap_line_length": 0,
    "css_indent_comments": true,
    "css_convert_quotes": "none",
    "css_align_assignments": false,
    "css_no_lead_zero": false,
    "css_configPath": "",
    "css_predefinedConfig": "csscomb",
    "d_configPath": "",
    "gherkin_indent_size": 2,
    "gherkin_indent_char": " ",
    "fortran_emacs_path": "",
    "fortran_emacs_script_path": "",
    "html_indent_size": 2,
    "html_indent_char": " ",
    "html_brace_style": "collapse",
    "html_indent_scripts": "normal",
    "html_wrap_attributes": "auto",
    "html_wrap_attributes_indent_size": 2,
    "html_preserve_newlines": true,
    "html_max_preserve_newlines": 10,
    "html_unformatted": [
        "a",
        "span",
        "img",
        "bdo",
        "em",
        "strong",
        "dfn",
        "code",
        "samp",
        "kbd",
        "var",
        "cite",
        "abbr",
        "acronym",
        "q",
        "sub",
        "sup",
        "tt",
        "i",
        "b",
        "big",
        "small",
        "u",
        "s",
        "strike",
        "font",
        "ins",
        "del",
        "pre",
        "address",
        "dt",
        "h1",
        "h2",
        "h3",
        "h4",
        "h5",
        "h6"
    ],
    "html_extra_liners": [
        "head",
        "body",
        "/html"
    ],
    "java_configPath": "",
    "js_indent_size": 2,
    "js_indent_char": " ",
    "js_indent_level": 0,
    "js_indent_with_tabs": false,
    "js_preserve_newlines": true,
    "js_max_preserve_newlines": 10,
    "js_space_in_paren": false,
    "js_jslint_happy": false,
    "js_space_after_anon_function": false,
    "js_brace_style": "collapse",
    "js_break_chained_methods": false,
    "js_keep_array_indentation": false,
    "js_keep_function_indentation": false,
    "js_space_before_conditional": true,
    "js_eval_code": false,
    "js_unescape_strings": false,
    "js_wrap_line_length": 0,
    "js_end_with_newline": false,
    "js_end_with_comma": false,
    "markdown_gfm": true,
    "markdown_yaml": true,
    "markdown_commonmark": false,
    "objectivec_configPath": "",
    "pawn_configPath": "",
    "perl_perltidy_profile": "",
    "php_cs_fixer_path": "",
    "php_fixers": "",
    "php_level": "",
    "php_phpcbf_path": "",
    "php_standard": "",
    "python_max_line_length": 79,
    "python_indent_size": 4,
    "python_ignore": [
        "E24"
    ],
    "python_sort_imports": false,
    "ruby_indent_size": 2,
    "ruby_rubocop_path": "",
    "ruby_indent_char": " ",
    "rust_rustfmt_path": "",
    "sql_indent_size": 2,
    "sql_keywords": "upper",
    "sql_identifiers": "unchanged",
    "vala_configPath": "",
    "language_apex_disabled": false,
    "language_apex_default_beautifier": "Uncrustify",
    "language_apex_beautify_on_save": false,
    "language_arduino_disabled": false,
    "language_arduino_default_beautifier": "Uncrustify",
    "language_arduino_beautify_on_save": false,
    "language_cs_disabled": false,
    "language_cs_default_beautifier": "Uncrustify",
    "language_cs_beautify_on_save": false,
    "language_c_disabled": false,
    "language_c_default_beautifier": "Uncrustify",
    "language_c_beautify_on_save": false,
    "language_coffeescript_disabled": false,
    "language_coffeescript_default_beautifier": "coffee-fmt",
    "language_coffeescript_beautify_on_save": false,
    "language_cfml_disabled": false,
    "language_cfml_default_beautifier": "Pretty Diff",
    "language_cfml_beautify_on_save": false,
    "language_cpp_disabled": false,
    "language_cpp_default_beautifier": "Uncrustify",
    "language_cpp_beautify_on_save": false,
    "language_css_disabled": false,
    "language_css_default_beautifier": "JS Beautify",
    "language_css_beautify_on_save": false,
    "language_csv_disabled": false,
    "language_csv_default_beautifier": "Pretty Diff",
    "language_csv_beautify_on_save": false,
    "language_d_disabled": false,
    "language_d_default_beautifier": "Uncrustify",
    "language_d_beautify_on_save": false,
    "language_ejs_disabled": false,
    "language_ejs_default_beautifier": "Pretty Diff",
    "language_ejs_beautify_on_save": false,
    "language_elm_disabled": false,
    "language_elm_default_beautifier": "elm-format",
    "language_elm_beautify_on_save": false,
    "language_erb_disabled": false,
    "language_erb_default_beautifier": "Pretty Diff",
    "language_erb_beautify_on_save": false,
    "language_erlang_disabled": false,
    "language_erlang_default_beautifier": "erl_tidy",
    "language_erlang_beautify_on_save": false,
    "language_gherkin_disabled": false,
    "language_gherkin_default_beautifier": "Gherkin formatter",
    "language_gherkin_beautify_on_save": false,
    "language_go_disabled": false,
    "language_go_default_beautifier": "gofmt",
    "language_go_beautify_on_save": false,
    "language_fortran_disabled": false,
    "language_fortran_default_beautifier": "Fortran Beautifier",
    "language_fortran_beautify_on_save": false,
    "language_handlebars_disabled": false,
    "language_handlebars_default_beautifier": "JS Beautify",
    "language_handlebars_beautify_on_save": false,
    "language_haskell_disabled": false,
    "language_haskell_default_beautifier": "stylish-haskell",
    "language_haskell_beautify_on_save": false,
    "language_html_disabled": false,
    "language_html_default_beautifier": "JS Beautify",
    "language_html_beautify_on_save": false,
    "language_java_disabled": false,
    "language_java_default_beautifier": "Uncrustify",
    "language_java_beautify_on_save": false,
    "language_js_disabled": false,
    "language_js_default_beautifier": "JS Beautify",
    "language_js_beautify_on_save": false,
    "language_json_disabled": false,
    "language_json_default_beautifier": "JS Beautify",
    "language_json_beautify_on_save": false,
    "language_jsx_disabled": false,
    "language_jsx_default_beautifier": "Pretty Diff",
    "language_jsx_beautify_on_save": false,
    "language_less_disabled": false,
    "language_less_default_beautifier": "Pretty Diff",
    "language_less_beautify_on_save": false,
    "language_markdown_disabled": false,
    "language_markdown_default_beautifier": "Tidy Markdown",
    "language_markdown_beautify_on_save": false,
    "language_marko_disabled": false,
    "language_marko_default_beautifier": "JS Beautify",
    "language_marko_beautify_on_save": false,
    "language_mustache_disabled": false,
    "language_mustache_default_beautifier": "JS Beautify",
    "language_mustache_beautify_on_save": false,
    "language_objectivec_disabled": false,
    "language_objectivec_default_beautifier": "Uncrustify",
    "language_objectivec_beautify_on_save": false,
    "language_pawn_disabled": false,
    "language_pawn_default_beautifier": "Uncrustify",
    "language_pawn_beautify_on_save": false,
    "language_perl_disabled": false,
    "language_perl_default_beautifier": "Perltidy",
    "language_perl_beautify_on_save": false,
    "language_php_disabled": false,
    "language_php_default_beautifier": "PHP-CS-Fixer",
    "language_php_beautify_on_save": false,
    "language_puppet_disabled": false,
    "language_puppet_default_beautifier": "puppet-lint",
    "language_puppet_beautify_on_save": false,
    "language_python_disabled": false,
    "language_python_default_beautifier": "autopep8",
    "language_python_beautify_on_save": false,
    "language_riot_disabled": false,
    "language_riot_beautify_on_save": false,
    "language_ruby_disabled": false,
    "language_ruby_default_beautifier": "Rubocop",
    "language_ruby_beautify_on_save": false,
    "language_rust_disabled": false,
    "language_rust_default_beautifier": "rustfmt",
    "language_rust_beautify_on_save": false,
    "language_sass_disabled": false,
    "language_sass_default_beautifier": "Pretty Diff",
    "language_sass_beautify_on_save": false,
    "language_scss_disabled": false,
    "language_scss_default_beautifier": "Pretty Diff",
    "language_scss_beautify_on_save": false,
    "language_spacebars_disabled": false,
    "language_spacebars_default_beautifier": "Pretty Diff",
    "language_spacebars_beautify_on_save": false,
    "language_sql_disabled": false,
    "language_sql_default_beautifier": "sqlformat",
    "language_sql_beautify_on_save": false,
    "language_svg_disabled": false,
    "language_svg_default_beautifier": "Pretty Diff",
    "language_svg_beautify_on_save": false,
    "language_swig_disabled": false,
    "language_swig_default_beautifier": "Pretty Diff",
    "language_swig_beautify_on_save": false,
    "language_tss_disabled": false,
    "language_tss_default_beautifier": "Pretty Diff",
    "language_tss_beautify_on_save": false,
    "language_twig_disabled": false,
    "language_twig_default_beautifier": "Pretty Diff",
    "language_twig_beautify_on_save": false,
    "language_typescript_disabled": false,
    "language_typescript_default_beautifier": "TypeScript Formatter",
    "language_typescript_beautify_on_save": false,
    "language_vala_disabled": false,
    "language_vala_default_beautifier": "Uncrustify",
    "language_vala_beautify_on_save": false,
    "language_visualforce_disabled": false,
    "language_visualforce_default_beautifier": "Pretty Diff",
    "language_visualforce_beautify_on_save": false,
    "language_xml_disabled": false,
    "language_xml_default_beautifier": "Pretty Diff",
    "language_xml_beautify_on_save": false,
    "language_xtemplate_disabled": false,
    "language_xtemplate_default_beautifier": "Pretty Diff",
    "language_xtemplate_beautify_on_save": false
}

Beautification options

Editor Options: Options from Atom Editor settings

{
    "_default": {
        "indent_size": 2,
        "indent_char": " ",
        "indent_with_tabs": false
    }
}

Config Options: Options from Atom Beautify package settings

{
    "css": {
        "force_indentation": true,
        "preserve_newlines": true,
        "indent_size": 2,
        "indent_char": " ",
        "selector_separator_newline": false,
        "newline_between_rules": false,
        "wrap_line_length": 0,
        "indent_comments": true,
        "convert_quotes": "none",
        "align_assignments": false,
        "no_lead_zero": false,
        "configPath": "",
        "predefinedConfig": "csscomb"
    },
    "html": {
        "end_with_newline": true,
        "indent_inner_html": true,
        "wrap_line_length": 90000,
        "indent_size": 2,
        "indent_char": " ",
        "brace_style": "collapse",
        "indent_scripts": "normal",
        "wrap_attributes": "auto",
        "wrap_attributes_indent_size": 2,
        "preserve_newlines": true,
        "max_preserve_newlines": 10,
        "unformatted": [
            "a",
            "span",
            "img",
            "bdo",
            "em",
            "strong",
            "dfn",
            "code",
            "samp",
            "kbd",
            "var",
            "cite",
            "abbr",
            "acronym",
            "q",
            "sub",
            "sup",
            "tt",
            "i",
            "b",
            "big",
            "small",
            "u",
            "s",
            "strike",
            "font",
            "ins",
            "del",
            "pre",
            "address",
            "dt",
            "h1",
            "h2",
            "h3",
            "h4",
            "h5",
            "h6"
        ],
        "extra_liners": [
            "head",
            "body",
            "/html"
        ]
    },
    "apex": {
        "configPath": ""
    },
    "arduino": {
        "configPath": ""
    },
    "cs": {
        "configPath": ""
    },
    "c": {
        "configPath": ""
    },
    "cfml": {
        "indent_inner_html": false,
        "indent_size": 2,
        "indent_char": " ",
        "brace_style": "collapse",
        "indent_scripts": "normal",
        "wrap_line_length": 250,
        "wrap_attributes": "auto",
        "wrap_attributes_indent_size": 2,
        "preserve_newlines": true,
        "max_preserve_newlines": 10,
        "unformatted": [
            "a",
            "sub",
            "sup",
            "b",
            "i",
            "u"
        ],
        "end_with_newline": false,
        "extra_liners": [
            "head",
            "body",
            "/html"
        ]
    },
    "cpp": {
        "configPath": ""
    },
    "d": {
        "configPath": ""
    },
    "gherkin": {
        "indent_size": 2,
        "indent_char": " "
    },
    "fortran": {
        "emacs_path": "",
        "emacs_script_path": ""
    },
    "java": {
        "configPath": ""
    },
    "js": {
        "indent_size": 2,
        "indent_char": " ",
        "indent_level": 0,
        "indent_with_tabs": false,
        "preserve_newlines": true,
        "max_preserve_newlines": 10,
        "space_in_paren": false,
        "jslint_happy": false,
        "space_after_anon_function": false,
        "brace_style": "collapse",
        "break_chained_methods": false,
        "keep_array_indentation": false,
        "keep_function_indentation": false,
        "space_before_conditional": true,
        "eval_code": false,
        "unescape_strings": false,
        "wrap_line_length": 0,
        "end_with_newline": false,
        "end_with_comma": false
    },
    "markdown": {
        "gfm": true,
        "yaml": true,
        "commonmark": false
    },
    "objectivec": {
        "configPath": ""
    },
    "pawn": {
        "configPath": ""
    },
    "perl": {
        "perltidy_profile": ""
    },
    "php": {
        "cs_fixer_path": "",
        "fixers": "",
        "level": "",
        "phpcbf_path": "",
        "standard": ""
    },
    "python": {
        "max_line_length": 79,
        "indent_size": 4,
        "ignore": [
            "E24"
        ],
        "sort_imports": false
    },
    "ruby": {
        "indent_size": 2,
        "rubocop_path": "",
        "indent_char": " "
    },
    "rust": {
        "rustfmt_path": ""
    },
    "sql": {
        "indent_size": 2,
        "keywords": "upper",
        "identifiers": "unchanged"
    },
    "vala": {
        "configPath": ""
    }
}

Home Options: Options from /Users/tim/.jsbeautifyrc

{
    "_default": {}
}

EditorConfig Options: Options from EditorConfig file

{
    "_default": {}
}

Project Options: Options from .jsbeautifyrc files starting from directory /Users/tim/Downloads/wordpress/wp-content/themes/twentysixteen and going up to root

[
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    },
    {
        "_default": {}
    }
]

Pre-Transformed Options: Combined options before transforming them given a beautifier's specifications

{
    "indent_size": 2,
    "indent_char": " ",
    "indent_with_tabs": false,
    "cs_fixer_path": "",
    "fixers": "",
    "level": "",
    "phpcbf_path": "",
    "standard": ""
}

Final Options

Final combined and transformed options that are used

{
    "indent_size": 2,
    "indent_char": " ",
    "indent_with_tabs": false,
    "cs_fixer_path": "",
    "fixers": "",
    "level": "",
    "phpcbf_path": "",
    "standard": ""
}

Results

Beautified File Contents:

<?php
/**
 * The template for displaying pages.
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages and that
 * other "pages" on your WordPress site will use a different template.
 *
 * @since Twenty Sixteen 1.0
 */
get_header(); ?>

<div id="primary" class="content-area">
    <main id="main" class="site-main" role="main">
        <?php
        // Start the loop.
        while (have_posts()) : the_post();

            // Include the page content template.
            get_template_part('template-parts/content', 'page');

            // If comments are open or we have at least one comment, load up the comment template.
            if (comments_open() || get_comments_number()) {
                comments_template();
            }

            // End of the loop.
        endwhile;
        ?>

    </main><!-- .site-main -->

    <?php get_sidebar('content-bottom'); ?>

</div><!-- .content-area -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>

Original vs. Beautified Diff:

Index: /Users/tim/Downloads/wordpress/wp-content/themes/twentysixteen/page.php
===================================================================
--- /Users/tim/Downloads/wordpress/wp-content/themes/twentysixteen/page.php original
+++ /Users/tim/Downloads/wordpress/wp-content/themes/twentysixteen/page.php beautified
@@ -1,40 +1,37 @@
 <?php
 /**
- * The template for displaying pages
+ * The template for displaying pages.
  *
  * This is the template that displays all pages by default.
  * Please note that this is the WordPress construct of pages and that
  * other "pages" on your WordPress site will use a different template.
  *
- * @package WordPress
- * @subpackage Twenty_Sixteen
  * @since Twenty Sixteen 1.0
  */
-
 get_header(); ?>

 <div id="primary" class="content-area">
    <main id="main" class="site-main" role="main">
        <?php
-       // Start the loop.
-       while ( have_posts() ) : the_post();
+        // Start the loop.
+        while (have_posts()) : the_post();

-           // Include the page content template.
-           get_template_part( 'template-parts/content', 'page' );
+            // Include the page content template.
+            get_template_part('template-parts/content', 'page');

-           // If comments are open or we have at least one comment, load up the comment template.
-           if ( comments_open() || get_comments_number() ) {
-               comments_template();
-           }
+            // If comments are open or we have at least one comment, load up the comment template.
+            if (comments_open() || get_comments_number()) {
+                comments_template();
+            }

-           // End of the loop.
-       endwhile;
-       ?>
+            // End of the loop.
+        endwhile;
+        ?>

    </main><!-- .site-main -->

-   <?php get_sidebar( 'content-bottom' ); ?>
+   <?php get_sidebar('content-bottom'); ?>

 </div><!-- .content-area -->

 <?php get_sidebar(); ?>

Logs

2016-03-07T22:46:10.850Z - info: [beautifiers/index.coffee] beautify <?php
/**
 * The template for displaying pages
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages and that
 * other "pages" on your WordPress site will use a different template.
 *
 * @package WordPress
 * @subpackage Twenty_Sixteen
 * @since Twenty Sixteen 1.0
 */

get_header(); ?>

<div id="primary" class="content-area">
    <main id="main" class="site-main" role="main">
        <?php
        // Start the loop.
        while ( have_posts() ) : the_post();

            // Include the page content template.
            get_template_part( 'template-parts/content', 'page' );

            // If comments are open or we have at least one comment, load up the comment template.
            if ( comments_open() || get_comments_number() ) {
                comments_template();
            }

            // End of the loop.
        endwhile;
        ?>

    </main><!-- .site-main -->

    <?php get_sidebar( 'content-bottom' ); ?>

</div><!-- .content-area -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>
 [ { _default: { indent_size: 2, indent_char: ' ', indent_with_tabs: false } },
  { css: 
     { force_indentation: true,
       preserve_newlines: true,
       indent_size: 2,
       indent_char: ' ',
       selector_separator_newline: false,
       newline_between_rules: false,
       wrap_line_length: 0,
       indent_comments: true,
       convert_quotes: 'none',
       align_assignments: false,
       no_lead_zero: false,
       configPath: '',
       predefinedConfig: 'csscomb' },
    html: 
     { end_with_newline: true,
       indent_inner_html: true,
       wrap_line_length: 90000,
       indent_size: 2,
       indent_char: ' ',
       brace_style: 'collapse',
       indent_scripts: 'normal',
       wrap_attributes: 'auto',
       wrap_attributes_indent_size: 2,
       preserve_newlines: true,
       max_preserve_newlines: 10,
       unformatted: [Object],
       extra_liners: [Object] },
    apex: { configPath: '' },
    arduino: { configPath: '' },
    cs: { configPath: '' },
    c: { configPath: '' },
    cfml: 
     { indent_inner_html: false,
       indent_size: 2,
       indent_char: ' ',
       brace_style: 'collapse',
       indent_scripts: 'normal',
       wrap_line_length: 250,
       wrap_attributes: 'auto',
       wrap_attributes_indent_size: 2,
       preserve_newlines: true,
       max_preserve_newlines: 10,
       unformatted: [Object],
       end_with_newline: false,
       extra_liners: [Object] },
    cpp: { configPath: '' },
    d: { configPath: '' },
    gherkin: { indent_size: 2, indent_char: ' ' },
    fortran: { emacs_path: '', emacs_script_path: '' },
    java: { configPath: '' },
    js: 
     { indent_size: 2,
       indent_char: ' ',
       indent_level: 0,
       indent_with_tabs: false,
       preserve_newlines: true,
       max_preserve_newlines: 10,
       space_in_paren: false,
       jslint_happy: false,
       space_after_anon_function: false,
       brace_style: 'collapse',
       break_chained_methods: false,
       keep_array_indentation: false,
       keep_function_indentation: false,
       space_before_conditional: true,
       eval_code: false,
       unescape_strings: false,
       wrap_line_length: 0,
       end_with_newline: false,
       end_with_comma: false },
    markdown: { gfm: true, yaml: true, commonmark: false },
    objectivec: { configPath: '' },
    pawn: { configPath: '' },
    perl: { perltidy_profile: '' },
    php: 
     { cs_fixer_path: '',
       fixers: '',
       level: '',
       phpcbf_path: '',
       standard: '' },
    python: 
     { max_line_length: 79,
       indent_size: 4,
       ignore: [Object],
       sort_imports: false },
    ruby: { indent_size: 2, rubocop_path: '', indent_char: ' ' },
    rust: { rustfmt_path: '' },
    sql: { indent_size: 2, keywords: 'upper', identifiers: 'unchanged' },
    vala: { configPath: '' } },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} },
  { _default: {} } ] PHP /Users/tim/Downloads/wordpress/wp-content/themes/twentysixteen/page.php undefined
2016-03-07T22:46:10.850Z - verbose: [beautifiers/index.coffee]  indent_size=2, indent_char= , indent_with_tabs=false, force_indentation=true, preserve_newlines=true, indent_size=2, indent_char= , selector_separator_newline=false, newline_between_rules=false, wrap_line_length=0, indent_comments=true, convert_quotes=none, align_assignments=false, no_lead_zero=false, configPath=, predefinedConfig=csscomb, end_with_newline=true, indent_inner_html=true, wrap_line_length=90000, indent_size=2, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_attributes=auto, wrap_attributes_indent_size=2, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, span, img, bdo, em, strong, dfn, code, samp, kbd, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small, u, s, strike, font, ins, del, pre, address, dt, h1, h2, h3, h4, h5, h6], extra_liners=[head, body, /html], configPath=, configPath=, configPath=, configPath=, indent_inner_html=false, indent_size=2, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=2, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, sub, sup, b, i, u], end_with_newline=false, extra_liners=[head, body, /html], configPath=, configPath=, indent_size=2, indent_char= , emacs_path=, emacs_script_path=, configPath=, indent_size=2, indent_char= , indent_level=0, indent_with_tabs=false, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, space_after_anon_function=false, brace_style=collapse, break_chained_methods=false, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, eval_code=false, unescape_strings=false, wrap_line_length=0, end_with_newline=false, end_with_comma=false, gfm=true, yaml=true, commonmark=false, configPath=, configPath=, perltidy_profile=, cs_fixer_path=, fixers=, level=, phpcbf_path=, standard=, max_line_length=79, indent_size=4, ignore=[E24], sort_imports=false, indent_size=2, rubocop_path=, indent_char= , rustfmt_path=, indent_size=2, keywords=upper, identifiers=unchanged, configPath=, , , , , , , , , 
2016-03-07T22:46:10.851Z - verbose: [beautifiers/index.coffee] [ { name: 'PHP',
    namespace: 'php',
    grammars: [ 'PHP' ],
    extensions: [ 'php', 'module', 'inc' ],
    options: 
     { cs_fixer_path: [Object],
       fixers: [Object],
       level: [Object],
       phpcbf_path: [Object],
       standard: [Object] },
    beautifiers: [ 'PHP-CS-Fixer', 'PHPCBF' ] } ] 'PHP' 'php'
2016-03-07T22:46:10.852Z - verbose: [beautifiers/index.coffee] Language PHP supported
2016-03-07T22:46:10.852Z - verbose: [beautifiers/index.coffee] getOptions selections [ 'php' ] indent_size=2, indent_char= , indent_with_tabs=false, force_indentation=true, preserve_newlines=true, indent_size=2, indent_char= , selector_separator_newline=false, newline_between_rules=false, wrap_line_length=0, indent_comments=true, convert_quotes=none, align_assignments=false, no_lead_zero=false, configPath=, predefinedConfig=csscomb, end_with_newline=true, indent_inner_html=true, wrap_line_length=90000, indent_size=2, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_attributes=auto, wrap_attributes_indent_size=2, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, span, img, bdo, em, strong, dfn, code, samp, kbd, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small, u, s, strike, font, ins, del, pre, address, dt, h1, h2, h3, h4, h5, h6], extra_liners=[head, body, /html], configPath=, configPath=, configPath=, configPath=, indent_inner_html=false, indent_size=2, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=2, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, sub, sup, b, i, u], end_with_newline=false, extra_liners=[head, body, /html], configPath=, configPath=, indent_size=2, indent_char= , emacs_path=, emacs_script_path=, configPath=, indent_size=2, indent_char= , indent_level=0, indent_with_tabs=false, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, space_after_anon_function=false, brace_style=collapse, break_chained_methods=false, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, eval_code=false, unescape_strings=false, wrap_line_length=0, end_with_newline=false, end_with_comma=false, gfm=true, yaml=true, commonmark=false, configPath=, configPath=, perltidy_profile=, cs_fixer_path=, fixers=, level=, phpcbf_path=, standard=, max_line_length=79, indent_size=4, ignore=[E24], sort_imports=false, indent_size=2, rubocop_path=, indent_char= , rustfmt_path=, indent_size=2, keywords=upper, identifiers=unchanged, configPath=, , , , , , , , , 
2016-03-07T22:46:10.852Z - verbose: [beautifiers/index.coffee] true indent_size=2, indent_char= , indent_with_tabs=false
2016-03-07T22:46:10.852Z - verbose: [beautifiers/index.coffee] options php undefined
2016-03-07T22:46:10.852Z - verbose: [beautifiers/index.coffee] options php indent_size=2, indent_char= , indent_with_tabs=false
2016-03-07T22:46:10.852Z - verbose: [beautifiers/index.coffee] true force_indentation=true, preserve_newlines=true, indent_size=2, indent_char= , selector_separator_newline=false, newline_between_rules=false, wrap_line_length=0, indent_comments=true, convert_quotes=none, align_assignments=false, no_lead_zero=false, configPath=, predefinedConfig=csscomb, end_with_newline=true, indent_inner_html=true, wrap_line_length=90000, indent_size=2, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_attributes=auto, wrap_attributes_indent_size=2, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, span, img, bdo, em, strong, dfn, code, samp, kbd, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small, u, s, strike, font, ins, del, pre, address, dt, h1, h2, h3, h4, h5, h6], extra_liners=[head, body, /html], configPath=, configPath=, configPath=, configPath=, indent_inner_html=false, indent_size=2, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=2, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, sub, sup, b, i, u], end_with_newline=false, extra_liners=[head, body, /html], configPath=, configPath=, indent_size=2, indent_char= , emacs_path=, emacs_script_path=, configPath=, indent_size=2, indent_char= , indent_level=0, indent_with_tabs=false, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, space_after_anon_function=false, brace_style=collapse, break_chained_methods=false, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, eval_code=false, unescape_strings=false, wrap_line_length=0, end_with_newline=false, end_with_comma=false, gfm=true, yaml=true, commonmark=false, configPath=, configPath=, perltidy_profile=, cs_fixer_path=, fixers=, level=, phpcbf_path=, standard=, max_line_length=79, indent_size=4, ignore=[E24], sort_imports=false, indent_size=2, rubocop_path=, indent_char= , rustfmt_path=, indent_size=2, keywords=upper, identifiers=unchanged, configPath=
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] options php cs_fixer_path=, fixers=, level=, phpcbf_path=, standard=
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] options php cs_fixer_path=, fixers=, level=, phpcbf_path=, standard=
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] true 
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] options php undefined
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] options php
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] true 
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] options php undefined
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] options php
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] true 
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] options php undefined
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] options php
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] true 
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] options php undefined
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] options php
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] true 
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] options php undefined
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] options php
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] true 
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] options php undefined
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] options php
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] true 
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] options php undefined
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] options php
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] true 
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] options php undefined
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] options php
2016-03-07T22:46:10.853Z - verbose: [beautifiers/index.coffee] true 
2016-03-07T22:46:10.854Z - verbose: [beautifiers/index.coffee] options php undefined
2016-03-07T22:46:10.854Z - verbose: [beautifiers/index.coffee] options php
2016-03-07T22:46:10.854Z - verbose: [beautifiers/index.coffee] PHP name=PHP, namespace=php, grammars=[PHP], extensions=[php, module, inc], title=PHP - PHP-CS-Fixer Path, type=string, default=, description=Path to the `php-cs-fixer` CLI executable (Supported by PHP-CS-Fixer), beautifiers=[PHP-CS-Fixer], key=cs_fixer_path, $ref=$, type=string, default=, description=Add fixer(s). i.e. linefeed,-short_tag,indentation (Supported by PHP-CS-Fixer), title=PHP - Fixers, beautifiers=[PHP-CS-Fixer], key=fixers, $ref=$, type=string, default=, description=By default, all PSR-2 fixers and some additional ones are run. (Supported by PHP-CS-Fixer), title=PHP - Level, beautifiers=[PHP-CS-Fixer], key=level, $ref=$, title=PHP - PHPCBF Path, type=string, default=, description=Path to the `phpcbf` CLI executable (Supported by PHP-CS-Fixer), beautifiers=[PHP-CS-Fixer], key=phpcbf_path, $ref=$, title=PHP - PHPCBF Standard, type=string, default=, description=Standard name Squiz, PSR2, PSR1, PHPCS, PEAR, Zend, MySource... or path to CS rules (Supported by PHP-CS-Fixer, PHPCBF), beautifiers=[PHP-CS-Fixer, PHPCBF], key=standard, $ref=$, beautifiers=[PHP-CS-Fixer, PHPCBF]
2016-03-07T22:46:10.854Z - verbose: [beautifiers/index.coffee] language options: {
    "indent_size": 2,
    "indent_char": " ",
    "indent_with_tabs": false,
    "cs_fixer_path": "",
    "fixers": "",
    "level": "",
    "phpcbf_path": "",
    "standard": ""
}
2016-03-07T22:46:10.854Z - verbose: [beautifiers/index.coffee] PHP /Users/tim/Downloads/wordpress/wp-content/themes/twentysixteen/page.php { indent_size: 2,
  indent_char: ' ',
  indent_with_tabs: false,
  cs_fixer_path: '',
  fixers: '',
  level: '',
  phpcbf_path: '',
  standard: '' } indent_size=2, indent_char= , indent_with_tabs=false, force_indentation=true, preserve_newlines=true, indent_size=2, indent_char= , selector_separator_newline=false, newline_between_rules=false, wrap_line_length=0, indent_comments=true, convert_quotes=none, align_assignments=false, no_lead_zero=false, configPath=, predefinedConfig=csscomb, end_with_newline=true, indent_inner_html=true, wrap_line_length=90000, indent_size=2, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_attributes=auto, wrap_attributes_indent_size=2, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, span, img, bdo, em, strong, dfn, code, samp, kbd, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small, u, s, strike, font, ins, del, pre, address, dt, h1, h2, h3, h4, h5, h6], extra_liners=[head, body, /html], configPath=, configPath=, configPath=, configPath=, indent_inner_html=false, indent_size=2, indent_char= , brace_style=collapse, indent_scripts=normal, wrap_line_length=250, wrap_attributes=auto, wrap_attributes_indent_size=2, preserve_newlines=true, max_preserve_newlines=10, unformatted=[a, sub, sup, b, i, u], end_with_newline=false, extra_liners=[head, body, /html], configPath=, configPath=, indent_size=2, indent_char= , emacs_path=, emacs_script_path=, configPath=, indent_size=2, indent_char= , indent_level=0, indent_with_tabs=false, preserve_newlines=true, max_preserve_newlines=10, space_in_paren=false, jslint_happy=false, space_after_anon_function=false, brace_style=collapse, break_chained_methods=false, keep_array_indentation=false, keep_function_indentation=false, space_before_conditional=true, eval_code=false, unescape_strings=false, wrap_line_length=0, end_with_newline=false, end_with_comma=false, gfm=true, yaml=true, commonmark=false, configPath=, configPath=, perltidy_profile=, cs_fixer_path=, fixers=, level=, phpcbf_path=, standard=, max_line_length=79, indent_size=4, ignore=[E24], sort_imports=false, indent_size=2, rubocop_path=, indent_char= , rustfmt_path=, indent_size=2, keywords=upper, identifiers=unchanged, configPath=, , , , , , , , , 
2016-03-07T22:46:10.854Z - verbose: [beautifiers/index.coffee] beautifiers 0=PHP-CS-Fixer, 1=PHPCBF
2016-03-07T22:46:10.854Z - verbose: [beautifiers/index.coffee] beautifier PHP-CS-Fixer
2016-03-07T22:46:10.857Z - debug: [beautifiers/beautifier.coffee] php-cs-fixer indent_size=2, indent_char= , indent_with_tabs=false, cs_fixer_path=, fixers=, level=, phpcbf_path=, standard=
2016-03-07T22:46:10.871Z - debug: [beautifiers/beautifier.coffee] tempFile temp null path=/var/folders/9_/b5zp3c7x2_d6xvxzdtcgfm700000gn/T/temp11628-40523-1q9dui8, fd=119
2016-03-07T22:46:10.872Z - debug: [beautifiers/beautifier.coffee] exeName, args: php-cs-fixer 0=fix, 1=undefined, 2=undefined, 3=/var/folders/9_/b5zp3c7x2_d6xvxzdtcgfm700000gn/T/temp11628-40523-1q9dui8
2016-03-07T22:46:11.441Z - debug: [beautifiers/beautifier.coffee] exePath, env: /usr/local/bin/php-cs-fixer MAMP_PHP=/Applications/MAMP/bin/php/php5.6.1/bin, rvm_bin_path=/Users/tim/.rvm/bin, SHELL=/bin/bash, TMPDIR=/var/folders/9_/b5zp3c7x2_d6xvxzdtcgfm700000gn/T/, Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.eoG1sDuArG/Render, ATOM_HOME=/Users/tim/.atom, rvm_stored_umask=0022, USER=tim, _system_type=Darwin, rvm_path=/Users/tim/.rvm, SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.DxIOimtT27/Listeners, __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0, rvm_prefix=/Users/tim, GOOGLE_API_KEY=AIzaSyAQfxPJiounkhOjODEO5ZieffeBv6yft2Q, PATH=/Applications/MAMP/bin/php/php5.6.1/bin:/Users/tim/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/tim/.rvm/bin:/Applications/MAMP/Library/bin/, rvm_loaded_flag=1, PWD=/, NODE_PATH=/Applications/Atom.app/Contents/Resources/app.asar/exports, _system_arch=x86_64, XPC_FLAGS=0x0, NODE_ENV=production, _system_version=10.11, XPC_SERVICE_NAME=0, rvm_version=1.25.25 (master), SHLVL=1, HOME=/Users/tim, rvm_ruby_string=system, LOGNAME=tim, rvm_delete_flag=0, DISPLAY=/private/tmp/com.apple.launchd.KfiIf0g3nb/org.macosforge.xquartz:0, rvm_user_install_flag=1, _system_name=OSX, _=/usr/bin/env
2016-03-07T22:46:11.442Z - debug: [beautifiers/beautifier.coffee] spawn /usr/local/bin/php-cs-fixer 0=fix, 1=/var/folders/9_/b5zp3c7x2_d6xvxzdtcgfm700000gn/T/temp11628-40523-1q9dui8
2016-03-07T22:46:12.095Z - debug: [beautifiers/beautifier.coffee] spawn done 1     1) /var/folders/9_/b5zp3c7x2_d6xvxzdtcgfm700000gn/T/temp11628-40523-1q9dui8
Fixed all files in 0.209 seconds, 5.500 MB memory used

2016-03-07T22:46:12.097Z - verbose: [beautifiers/beautifier.coffee] spawn result 1    1) /var/folders/9_/b5zp3c7x2_d6xvxzdtcgfm700000gn/T/temp11628-40523-1q9dui8
Fixed all files in 0.209 seconds, 5.500 MB memory used
prettydiff commented 8 years ago

Awesome, hat is exactly what I meant. Are you running PHP on your local computer (where you are running Atom)? The selected beautifier, PHP-CS-Fixer, is written in PHP and requires a local PHP runtime.

If we can determine this is the problem I can close the issue.

canarystudio commented 8 years ago

I run MAMP for PHP, perhaps this is the issue?

which php /Applications/MAMP/bin/php/php5.6.1/bin/php

prettydiff commented 8 years ago

That could be the issue. Is there a way you could alias or symlink a standard PHP path to that one?

Glavin001 commented 7 years ago

2016-03-07T22:46:12.095Z - debug: [beautifiers/beautifier.coffee] spawn done 1 1) /var/folders/9_/b5zp3c7x2_d6xvxzdtcgfm700000gn/T/temp11628-40523-1q9dui8 Fixed all files in 0.209 seconds, 5.500 MB memory used

Looks to me this worked as expected, from an Atom-Beautify perspective.

Also PHP language and PHP-CS-Fixer beautifier appear to not support indentation:

Furthermore, HTML is not handled by the PHP beautifiers. https://github.com/Glavin001/atom-beautify/issues/457 should resolve this, so I am going to close as a duplicate of https://github.com/Glavin001/atom-beautify/issues/457