Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/php fixer #375

Open
wants to merge 4 commits into
base: feature/php-fixer
Choose a base branch
from

Conversation

ashucg
Copy link
Contributor

@ashucg ashucg commented Aug 10, 2018

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"
            },
        },
    },
}

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
Owner

Is it backward compatible with current config?

@ashucg
Copy link
Contributor Author

ashucg commented Aug 31, 2018

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
Owner

@ashucg do you still use this package?

@ashucg
Copy link
Contributor Author

ashucg commented Oct 17, 2019

@akalongman yes, I do

@akalongman
Copy link
Owner

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

@ashucg
Copy link
Contributor Author

ashucg commented Oct 18, 2019

@akalongman sure, I can help with that.

@ashucg
Copy link
Contributor Author

ashucg commented Nov 30, 2019

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
Owner

@ashucg I like your approach 👍

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.

None yet

2 participants