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

Added an .editorconfig to dictate project formatting settings #74

Merged
merged 3 commits into from
Feb 13, 2015

Conversation

Mpdreamz
Copy link
Member

Every editor under the sun supports (or should!) http://editorconfig.org/

Visual studio has an extension: https://visualstudiogallery.msdn.microsoft.com/c8bccfe2-650c-4b42-bc5c-845e21f96328

This will force your editor settings to be changed when working on our project to the settings we dictate.

Editorconfig will leave your defaults alone, so when you switch back to a private project with no editorconfig file it will keep using your default settings there.

Ties into #70

@nosami
Copy link
Contributor

nosami commented Feb 13, 2015

kproj files are indented by 2 spaces. I don't think anyone would ever edit those, but it should probably be added.

@khellang
Copy link

I think corefx's .editorconfig makes sense. Maybe something like:

# EditorConfig is awesome: http://EditorConfig.org

root = true

[*]
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.cs]
indent_size = 4

@nosami
Copy link
Contributor

nosami commented Feb 13, 2015

@khellang looks good to me.

@Mpdreamz
Copy link
Member Author

👍 thanks @khellang will update the PR shortly

That url should also be quoted though, even if editorconfig files can handle invalid keys (part of its test suite).

@Mpdreamz
Copy link
Member Author

Updated, do we care about squashing and rebasing?

@nosami
Copy link
Contributor

nosami commented Feb 13, 2015

nah! thanks!

nosami added a commit that referenced this pull request Feb 13, 2015
Added an .editorconfig to dictate project formatting settings
@nosami nosami merged commit f4e24f7 into master Feb 13, 2015
@jrieken
Copy link
Contributor

jrieken commented Feb 13, 2015

👍

@jrieken
Copy link
Contributor

jrieken commented Feb 13, 2015

@Mpdreamz didn't you also do an API (editor config nuget package) so that we can seed the roslyn formatter with those settings?

@Mpdreamz
Copy link
Member Author

I did, I just updated it today so that it includes a proper aspnetcore50 build in the nuget package. Just did a git checkout -b feature/editorconfig-powered-formatting to start on #31 :)

@Mpdreamz
Copy link
Member Author

It wont actually seed once though, it will lookup everytime since thats the editorconfig way, i.e you might very well have different settings for *.generated.cs vs *.cs files.

Usually an editor opens a file and seeds that file with editorconfig settings, but we dont track editors opening and closing files on the server right? or do we?

@jrieken
Copy link
Contributor

jrieken commented Feb 13, 2015

yeah - that's what I meant. we should have a thing (service?) which returns an OptionSet that applies to the current file.

@nosami nosami deleted the fix/editorconfigfile branch February 16, 2015 13:40
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.

4 participants