Closed secondmanveran closed 2 years ago
I am sorry, but we don't have plans for this.
If i understand correctly its not possible to choose indenting with tabs
with Pint in any way? Because it "fixes" my project to spaces
and from my test i can't even fallback to PHP-CS-Fixer setting the indentation https://stackoverflow.com/a/64495193
I mean yes i understand if i need these settings i should use PHP-CS-Fixer directly. But it would be exactly that kind of "minimalism" that makes this very common setting much easier to set than in PHP-CS-Fixer what i would Pint expect to do.
Because Pint becoming Laravel default it essentially forces everyone to spaces
. Not sure why is that required.
@iskrisis
EXACTLY! I use spaces, but only 2 ... and even this isn't possible. It's like saying, oh sorry we only support Pusher for broadcasting, or MySQL for database.
This is NOT the Laravel way.
I'd use
tab-width: 2
use-tabs: true
sadly... many of us will be forced to ignore laravel/pint
unless @nunomaduro customize these settings, while admitting that this package is really useful for code formatting/standardization.
it is a pity to be unable to use it.
after executing ./vendor/bin/pint
, we may use another tool to only care about indentation.
terrible hack, but at least we can benefit from pint in a (cumbersome) way...
anyone knows what may be a good package? ... maybe PHP-CS-Fixer itself?
@camiant
I think then it's better to use a pure PHP-CS-fixer without pint.
@wischerdson
Agreed. Or simply spring for StyleCI. For all it does it's extremely affordable and Graham is a good cat, easy to work with and great support.
I think everybody understands there are other solutions. It just seems like this very nice magic wrapper that would be far more useful if it wasn't so highly dogmatic. Pint supports every other crazy setting PHPCSFIXER does just not 2 main settings people are most likely change to their preference.
Logical conclusion is that that this is a feature and it's on purpose. Which is strange but sure totally your decision to make. It will probably force many people to 2 spaces. 🤷
@iskrisis
The default is the typical 4 spaces I believe ... that's the issue. We'd like to be able to change the space count and the ability to use tabs or spaces.
There may be other configs that are missing as well. But yes, if you use the default "Laravel" preset, then this is very convenient.
I have forked it to make the changes for my own use, but I haven't had time to work on it yet.
I also went back to PHP CS Fixer after 5 minutes of using the Pint. There is no benefit to using the Pint other than a nice console output, only the downsides. Pint it's just a limited PHP CS Fixer wrapper.
I know this issue is closed, and I know that this is religious, dogmatic issue for many, but this has become an important accessibility issue too. This hard-converted me to the tabs camp, and I'd encourage the Pint team to re-consider this.
@bluehaoran @iskrisis @camiant @bbprojectnet
I've released a more configurable version called Pinte
If there's any further configuration options you'd like to see past setIndent
and setLineEndings
feel free to open an issue or PR.
have you implemented a key in pinte.json
like indentSize
(e.g. 2 / 4) ?
@camiant
Yeah if you look at the usage section of the readme you'll see.
{
"indent": "\t",
"lineEnding": "/r/n"
}
Of course you can use any value you can in PHP-CS-Fixer.
This MUST have the ability to set the indentation level and type if it's to be useful at all.
I, along with a great many others, don't use 4 spaces to indent. PHP-CS-Fixer has the ability to set the indentation as referenced in #24
I would suggest implementing this as a rule just as StyleCI does:
Please add this as I'm not able to use your package until you do.
Thanks