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 file #751

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
5 participants
@MarioLiebisch
Member

MarioLiebisch commented Dec 13, 2014

This allows most IDEs and editors (with the proper plugin) to automatically use the correct identation and line endings.

In short, you'll never ever have to worry about tabs or line breaks in your code again. In additon, this won't have any effect on your other files or projects, who'll continue to use your own global or custom settings.

There are plugins available for Microsoft Visual Studio, Notepad++, gedit, vim, and many other popular editors and IDEs.

More information can be found on http://www.editorconfig.org/.

I'm just not sure whether this should be handled differently based on extensions. Are there any files where tabs are preferred?

@mantognini

This comment has been minimized.

Show comment
Hide comment
@mantognini

mantognini Dec 13, 2014

Member

It's the first time I hear about that. I'm wondering if those plugins are really used.

Member

mantognini commented Dec 13, 2014

It's the first time I hear about that. I'm wondering if those plugins are really used.

@MarioLiebisch

This comment has been minimized.

Show comment
Hide comment
@MarioLiebisch

MarioLiebisch Dec 13, 2014

Member

Notepad++ has it built-in and I'm using the MSVC one for quite some time now. :)

Member

MarioLiebisch commented Dec 13, 2014

Notepad++ has it built-in and I'm using the MSVC one for quite some time now. :)

@eXpl0it3r

This comment has been minimized.

Show comment
Hide comment
@eXpl0it3r

eXpl0it3r Dec 13, 2014

Member

Sounds interesting. If we add it, it should also force the line ending to LF and maybe we should limit it to certain file endings and if possible exclude some of the files (e.g. extlibs, stb_image, etc.).

Member

eXpl0it3r commented Dec 13, 2014

Sounds interesting. If we add it, it should also force the line ending to LF and maybe we should limit it to certain file endings and if possible exclude some of the files (e.g. extlibs, stb_image, etc.).

@Bromeon

This comment has been minimized.

Show comment
Hide comment
@Bromeon

Bromeon Dec 14, 2014

Member

It can be difficult to enforce consistent indentation globally because of external libraries.

Although I'm also using the MSVC EditorConfig add-on, I'm not sure how spread it really is.

Member

Bromeon commented Dec 14, 2014

It can be difficult to enforce consistent indentation globally because of external libraries.

Although I'm also using the MSVC EditorConfig add-on, I'm not sure how spread it really is.

@MarioLiebisch

This comment has been minimized.

Show comment
Hide comment
@MarioLiebisch

MarioLiebisch Dec 15, 2014

Member

Having a look at restricting it at specific paths. There's no harm for those not using it, so should just get it configured properly.

@eXpl0it3r End-of-line style is already enforced by git, so people are able to use the line ending they prefer. Wouldn't try to enforce that here as well as it might screw up some editors.

Member

MarioLiebisch commented Dec 15, 2014

Having a look at restricting it at specific paths. There's no harm for those not using it, so should just get it configured properly.

@eXpl0it3r End-of-line style is already enforced by git, so people are able to use the line ending they prefer. Wouldn't try to enforce that here as well as it might screw up some editors.

@TankOs

This comment has been minimized.

Show comment
Hide comment
@TankOs

TankOs Dec 18, 2014

Member

👍

Member

TankOs commented Dec 18, 2014

👍

@MarioLiebisch

This comment has been minimized.

Show comment
Hide comment
@MarioLiebisch

MarioLiebisch Dec 18, 2014

Member

Forgot to comment, but I've looked into restricting it to specific paths, which kinda works, but considering it won't change unedited files anyway, this seems to make the file/rules unnecessary complex.

Therefore I'd keep it as-is and only add exceptions in case any issues arrise (like some native makefile which would need tabs).

Member

MarioLiebisch commented Dec 18, 2014

Forgot to comment, but I've looked into restricting it to specific paths, which kinda works, but considering it won't change unedited files anyway, this seems to make the file/rules unnecessary complex.

Therefore I'd keep it as-is and only add exceptions in case any issues arrise (like some native makefile which would need tabs).

@mantognini

This comment has been minimized.

Show comment
Hide comment
@mantognini

mantognini Dec 18, 2014

Member

Wouldn't try to enforce [end-of-line style] here as well as it might screw up some editors.

From a non-user perspective it seems kind of complicated.. Is it really worth adding a config that we don't fully understand to SFML?

Member

mantognini commented Dec 18, 2014

Wouldn't try to enforce [end-of-line style] here as well as it might screw up some editors.

From a non-user perspective it seems kind of complicated.. Is it really worth adding a config that we don't fully understand to SFML?

@MarioLiebisch

This comment has been minimized.

Show comment
Hide comment
@MarioLiebisch

MarioLiebisch Dec 18, 2014

Member

From a non-user perspective it seems kind of complicated.. Is it really worth adding a config that we don't fully understand to SFML?

Ah, no! You misunderstood me (and I made a wrong assumption myself).

I basically thought of a situation where the local git repository works with Windows style line endings, which would be converted once committing changes (therefore enforced and unified by Git). If you'd force EditorConfig to replace line endings as well, you might essentially change line endings several time unintentionally (Unix -> Windows -> Unix).

However, I've just seen that SFML's .gitattributes file already enforces Unix' eol style (rather than the local system's style), so adding this won't cause any harm and would indeed just enforce what's already in place.

Going to update the PR. Keep in mind that these changes won't be applied to all files despite the filter being *. It will only be applied once actively editing target files. (Still let me know in case you spot any files that would need some other ruleset.)

Member

MarioLiebisch commented Dec 18, 2014

From a non-user perspective it seems kind of complicated.. Is it really worth adding a config that we don't fully understand to SFML?

Ah, no! You misunderstood me (and I made a wrong assumption myself).

I basically thought of a situation where the local git repository works with Windows style line endings, which would be converted once committing changes (therefore enforced and unified by Git). If you'd force EditorConfig to replace line endings as well, you might essentially change line endings several time unintentionally (Unix -> Windows -> Unix).

However, I've just seen that SFML's .gitattributes file already enforces Unix' eol style (rather than the local system's style), so adding this won't cause any harm and would indeed just enforce what's already in place.

Going to update the PR. Keep in mind that these changes won't be applied to all files despite the filter being *. It will only be applied once actively editing target files. (Still let me know in case you spot any files that would need some other ruleset.)

@TankOs

This comment has been minimized.

Show comment
Hide comment
@TankOs

TankOs Dec 19, 2014

Member

Looks good, worth a try. 👍 from me :)

Member

TankOs commented Dec 19, 2014

Looks good, worth a try. 👍 from me :)

Added an .editorconfig file
This allows most IDEs and editors (with the proper plugin) to
automatically use the correct identation and line endings.

In short, you'll never ever have to worry about tabs or line breaks in your
code again. In additon, this won't have any effect on your other files or
projects, who'll continue to use your own global or custom settings.

There are plugins available for Microsoft Visual Studio, Notepad++, gedit, vim,
and many other popular editors and IDEs.

More information can be found on http://www.editorconfig.org/.

@eXpl0it3r eXpl0it3r removed the s:unassigned label Jan 8, 2015

@MarioLiebisch

This comment has been minimized.

Show comment
Hide comment
@MarioLiebisch

MarioLiebisch Jan 30, 2015

Member

Any further opinions? Considering it's really just opt-in and there's no downside in using it (it will only improve things)... any objections merging this?

Member

MarioLiebisch commented Jan 30, 2015

Any further opinions? Considering it's really just opt-in and there's no downside in using it (it will only improve things)... any objections merging this?

@eXpl0it3r

This comment has been minimized.

Show comment
Hide comment
@eXpl0it3r

eXpl0it3r Jan 31, 2015

Member

Since nobody has voted against it and we have two "Yay", zero "Nay" and three "I don't care", this PR will be merged soon, unless someone raises any concerns.

Member

eXpl0it3r commented Jan 31, 2015

Since nobody has voted against it and we have two "Yay", zero "Nay" and three "I don't care", this PR will be merged soon, unless someone raises any concerns.

@eXpl0it3r eXpl0it3r added s:accepted and removed s:undecided labels Jan 31, 2015

@eXpl0it3r eXpl0it3r added this to the 2.3 milestone Jan 31, 2015

@eXpl0it3r eXpl0it3r self-assigned this Jan 31, 2015

@eXpl0it3r

This comment has been minimized.

Show comment
Hide comment
@eXpl0it3r

eXpl0it3r Feb 6, 2015

Member

Merged in 976c421

Member

eXpl0it3r commented Feb 6, 2015

Merged in 976c421

@eXpl0it3r eXpl0it3r closed this Feb 6, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment