-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Change number of spaces in tabs for all generated files #3219
Comments
Overridable/custom templates for |
How about making generate command look in the |
I like the idea of having a specific folder that angular-cli looks for and, if present, will use any templates present in that folder to override any default templates. That's what Visual Studio did for most of its T4 templates, and it's a system that works very well. Just publish the names of the templates and the default templates themselves, so we can modify them. Any codegen solution is only as useful as it is customizable. |
I also would very much like the possibilty to configure the tab size in any way. |
@thardy I understand the issue you are having here and it's not a trivial one to solve in a way that will make everyone happy. On the roadmap for the CLI is to provide the ability to have custom blueprints for all generations, so you will be able to have your own blueprints in the future. For right now, we are going to rely on editors/IDEs to handle the re-formatting of generated files so that developers can tailor their environments to how they and their team want their files formatted. To further explain it is not just a matter of simply specifying the number of tabs or spaces. There are many file formats to consider (i.e. *.ts *.json *.html) that some teams want to mix tabs vs spaces. I know this is likely not the response/answer you were looking for, but I ask for your patience as we do have a plan to deal with this to ease your frustrations. I'm going to leave this open for further discussion. |
I agree that the best and most comprehensive solution is custom blueprints. That way, everyone can do exactly what they want, when they want. It's good to hear that's on the roadmap. Thanks for your response. |
@Brocco What happened to keeping it open? |
The consensus between the OP (@thardy) and I was sufficient for me to know that this issue is OK to be accommodated currently by IDEs/editors and addressed with custom blueprints in the future. |
This should be available soon-ish via automatically running TS Lint fixers on generators. This is being tracked in #6272. Edit: actually #6272 (currently) will only allow spaces->tabs, not 4 spaces -> 2 spaces. There is an open feature request on TS Lint for that functionality: palantir/tslint#581. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This was already mentioned in #1252, but since that was ignored/closed without any resolution, I will open a new issue. The number of tabs angular-cli uses in all generated files needs to be configurable.
It's very frustrating to have to fight our editors whenever we use angular-cli to generate files. That goes against the entire purpose of the cli as a convenience mechanism. Most modern editors try hard to honor an existing file's tab spacing, causing angular-cli users to have to fight their editor whenever they generate a new file. We would also like to be able to keep our editors functioning this way for when we edit other people's source code. For source code we author ourselves, however, we'd like to control exactly how many spaces are used in tabs without having to fight against our code generation tools.
The text was updated successfully, but these errors were encountered: