alan-if / alan-docs

Alan IF Documentation Project

Home Page:https://git.io/alan-docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add EditorConfig to Enforce Code-Styles Consistency

tajmone opened this issue · comments

  • Create new dev-editorconfig branch, and:
    • Add EditorConfig settings to enforce code styles consistency in the various files types across all OSs and editors/IDEs.
    • Add script to validate code styles consistency via EClint (NPM) locally, to allow contributors to check their changes before committing.
    • Amend all sources until they pass the validation test.
  • Enable code styles consistency checks via Travis CI, to ensure that all commits and PRs are well formatted.
  • Merge into master branch.
  • Fix dev branches:
    • Rebase on master and
    • Amend all sources until they pass the validation test.

In order to pass the validation test, we also need to enforce EditorConfig setting in the /alan-xsl-fopub/ repository included in this repo as Git submodule:

  • Add EditorConfig settings to alan-xsl-fopub repository.
  • Update the Git Submodule pointer in this repository.

Since the alan-xsl-fopub repository will define it's EditorConfig settings as root = true, the validation tool will use those setting inside the Git submodule directory.


Thanks to EditorConfig we'll be able to enforce consistent code styles in the repository, and all modern editors should pick up those settings and enforce them over the user default settings when working on this repo — either natively or by installing a third party EditorConfig plug-in.

@thoni56, for Emacs you'll find an EditorConfig plugin here:

Hopefully the adoption of EditorConfig will solve many of the current conflicts due to noise changes added to the code due to different settings for indentation, trailing spaces, etc. I've been using it a lot in my repos during the past year, and it has improved the working experience a lot.