Bug 12545

Summary: Add EditorConfig file to the source tree
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Developer documentationAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: dcook, katrin.fischer
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 24774, 33358    
Attachments: Bug 12545: Add EditorConfig.org file to the source tree
Bug 12545: Add EditorConfig.org file to the source tree
Bug 12545: Add EditorConfig.org file to the source tree

Description Tomás Cohen Arazi 2014-07-09 14:18:58 UTC
It'd be usefull to have a .editorconfig [1] file, that enforces some of our coding guidelines, in the source tree top level.

Those developers that have their editors configured to honour the file, will benefit. Those that wouldn't use it, won't get bothered by the addition. So, a harmless addition that would benefit those that are interested.

There are plugins for several major editors:
- Emacs
- Vim
- SublimeText
- and so on...

[1] http://editorconfig.org/
Comment 1 Tomás Cohen Arazi 2014-07-09 14:31:13 UTC Comment hidden (obsolete)
Comment 2 David Cook 2014-07-23 23:35:51 UTC
I saw that there is a Notepad++ plugin (which is what I usually use), so I'd be keen to try this out sometime...
Comment 3 Tomás Cohen Arazi 2014-07-23 23:42:06 UTC
(In reply to David Cook from comment #2)
> I saw that there is a Notepad++ plugin (which is what I usually use), so I'd
> be keen to try this out sometime...

There is, indeed a plugin for it. The key idea is that if anyone works on different projects with different coding guidelines, the Koha-specific config is confined to the project.

Also, for people starting, we could add it (installing the necesary plugin) to the list of steps to setup the dev environment.
Comment 4 Chris Cormack 2014-07-29 07:04:31 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2014-08-22 10:03:40 UTC
Created attachment 31070 [details] [review]
Bug 12545: Add EditorConfig.org file to the source tree

This patch adds a .editorconfig file to the source tree, that
enforces some of our coding guidelines.

Some editors try to detect the desired configurations from the currently
opened file. As we have tons of old code that doesn't follow our current
coding guidelines, this can lead to unintended QA problmes.

To test:
- Apply the patch
- Verify the .editorconfig file is in the top-level directory
- See the .editorconfig file expresses our coding guidelines

Regards
To+

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 6 Tomás Cohen Arazi 2014-08-22 14:14:49 UTC
Patch pushed to master.