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

Wrong indentation with the saturn gen command #19

Open
mrkaspa opened this issue Jul 18, 2018 · 5 comments
Open

Wrong indentation with the saturn gen command #19

mrkaspa opened this issue Jul 18, 2018 · 5 comments

Comments

@mrkaspa
Copy link

mrkaspa commented Jul 18, 2018

dotnet saturn gen command generates modules indented with 2 spaces and the project scaffold has 4 space indentation

@rmunn
Copy link

rmunn commented Jul 19, 2018

When you mention the project scaffold, do you mean what you get by running dotnet new Saturn, e.g. https://github.com/SaturnFramework/Saturn.Template? Or do you mean https://github.com/fsprojects/ProjectScaffold?

This brings up an interesting question. What if someone prefers 4-space indents, and wants dotnet saturn gen to generate code that matches their style? Should the gen code look for a .editorconfig file and follow its indentation guidelines if it exists? Defaulting to 2-space indents seems sensible given that the Giraffe View Engine ends up having lots of nesting in your view functions. But if a project has already created a .editorconfig file specifying the project's preferred indent levels, then I think library users would appreciate having the dotnet saturn gen command match what they specified in .editorconfig.

@baronfel
Copy link
Contributor

@rmunn it might be possible to use something like https://github.com/amyboyd/editorconfig-cli as a post-template action to make sure the code is in sync with the users preferences?

@Krzysztof-Cieslak
Copy link
Member

I don't think we can do post-template action for formatting to correct indent... as we don't have formatter that's working well enough for F#. And, while fixing generator to look at the .editorconfig and doing correct indent should be fairly easy to do, i don't think there is a good way to do something like that for dotnet new commands.

Anyway, I certainly agree that both template and dotnet saturn gen should use the same indenting

@Krzysztof-Cieslak Krzysztof-Cieslak transferred this issue from SaturnFramework/Saturn Dec 10, 2018
@Krzysztof-Cieslak
Copy link
Member

Moved the issue to correct repo.

@ZaymonFC
Copy link
Contributor

ZaymonFC commented Aug 6, 2019

I'd be happy to work on this after #23 is reviewed.

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

No branches or pull requests

5 participants