Elsa icon indicating copy to clipboard operation
Elsa copied to clipboard

Implement rules from emacs style guide

Open Fuco1 opened this issue 7 years ago • 1 comments

https://github.com/bbatsov/emacs-lisp-style-guide

For inspiration look at https://github.com/Fuco1/Elsa/blob/master/elsa-ruleset.el the ruleset elsa-ruleset-style contains the style rules.

These are in turn defined in https://github.com/Fuco1/Elsa/blob/master/elsa-rules-list.el.

The naming of these files isn't great and I think we will need to split it apart better, somewhat in style of the extension and typed... so we will have elsa-ruleset-style.el which will define the ruleset and all the accompanying rules.

  • [ ] Syntax
    • [x] Don't wrap the else clause in progn
    • [x] Use when instead of (if .. (progn ...))
    • [ ] Use unless instead of (when (not ...))
    • [ ] Use t as catch-all in cond forms
  • [ ] Naming
    • [x] Use lisp-case
    • [ ] Use project prefix (how to detect this?)
    • [ ] Use _ prefix for unused lexical variables
    • [ ] Use -- for private functions (see #26, if there is no reference maybe it is public API and should not be private)
    • [ ] Face names don't end in -face
  • [ ] Functions
    • [ ] No lambda for hooks or settings
    • [ ] Don't quote lambda forms with '
    • [x] Don't wrap functions in lambdas
    • [ ] Use #' for quoting of functions

Fuco1 avatar Aug 15 '18 11:08 Fuco1

We can also look at the closure version https://github.com/bbatsov/clojure-style-guide some of the things might be relevant.

Fuco1 avatar Aug 16 '18 17:08 Fuco1