Skip to content

Feature/php fixer - #375

Closed
ashucg wants to merge 4 commits into
akalongman:feature/php-fixerfrom
ashucg:feature/php-fixer
Closed

ashucg wants to merge 4 commits into
akalongman:feature/php-fixerfrom
ashucg:feature/php-fixer

Conversation

@ashucg

@ashucg ashucg commented Aug 10, 2018

Copy link
Copy Markdown
Contributor

Added a new separate option to define PHP-CS-Fixer options/parameters allowing users to easily switch back to the former (phpF) if they want to

Example usage:

{
    "codeformatter_php_options": {
        "syntaxes": "php",

        // will be neglected because "passes_option" is defined
        "passes": ["AliasToMaster", "AlignDoubleArrow"],
        
        // php-cs-fixer will be used with these parameters
        // you can define empty object i.e., "passes_option": {} to use the former
        "passes_option": {
            "@PSR2": true,
            "blank_line_after_namespace": true,
            "concat_space": {
                "spacing": "none"
            },
            "array_syntax": {
                "syntax": "short"
            },
        },
    },
}

ashucg added 3 commits August 10, 2018 16:47
Added `passes_option` as a new package option to define php-cs-fixer options and fallback to phpf if `passes_option` is empty or not defined
@akalongman

Copy link
Copy Markdown
Owner

Is it backward compatible with current config?

@ashucg

ashucg commented Aug 31, 2018

Copy link
Copy Markdown
Contributor Author

I have not removed passes option from config so that users can switch between phpF and PHP-CS-Fixer. I have mentioned this under Example usage. I have not added documentation for PHP-CS-Fixer options because there are a lot of options to cover.

PS: sorry for replying this late

added `delete=False` to NamedTemporaryFile() - fixes `Unable to read from <file>` error on Windows
@akalongman

Copy link
Copy Markdown
Owner

@ashucg do you still use this package?

@ashucg

ashucg commented Oct 17, 2019

Copy link
Copy Markdown
Contributor Author

@akalongman yes, I do

@akalongman

Copy link
Copy Markdown
Owner

@ashucg could you help to migrate PHP formatting part from phpF to PHP Code Fixer entirely?

@ashucg

ashucg commented Oct 18, 2019

Copy link
Copy Markdown
Contributor Author

@akalongman sure, I can help with that.

@ashucg

ashucg commented Nov 30, 2019

Copy link
Copy Markdown
Contributor Author

Hi @akalongman,

I think I will have some spare time in December and I will finally get to work on migration part.

I was thinking about creating predefined rules using a dictionary to map phpF options to php-cs-fixer and after formatting the code, tell users to check console output for recommended php-cs-fixer options which they can simply copy and add to their User Package Settings . This would help users to get a working installation without going through php-cs-fixer's available options just to get a similar configuration.

Let me know your thoughts about the whole process.

@akalongman

Copy link
Copy Markdown
Owner

@ashucg I like your approach 👍

@akalongman

Copy link
Copy Markdown
Owner

Closing as stale: this targets the feature/php-fixer branch rather than master and has had no activity since 2019. Thanks for the contribution.

@akalongman akalongman closed this Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants