Skip to content

Commit

Permalink
Trac #21793: Document whitespace policy, provide editor configuration…
Browse files Browse the repository at this point in the history
…s for non-Python source files

This is a follow-up on #21792.

URL: https://trac.sagemath.org/21793
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): Jeroen Demeyer
  • Loading branch information
Release Manager authored and vbraun committed Dec 7, 2016
2 parents 54934ba + a23bca3 commit 33ba206
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .dir-locals.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")

((nil
;; Use space instead of tabs for indentation
(indent-tabs-mode . nil))
(makefile-mode
;; But use tabs in Makefiles
(indent-tabs-mode . t)))
2 changes: 1 addition & 1 deletion build/make/deps
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
###############################################################################
## -*- Makefile -*- ###########################################################
# This file ($SAGE_ROOT/build/make/deps) will be copied into
# $SAGE_ROOT/build/make/Makefile by $SAGE_ROOT/build/make/install
###############################################################################
Expand Down
21 changes: 21 additions & 0 deletions src/doc/en/developer/coding_basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,27 @@ See the files in ``SAGE_ROOT/src/doc/en/tutorial/`` for many
examples of how to include automated testing in ReST documentation for
Sage.


.. _section-coding-general-whitespace:

General Coding Style Regarding Whitespace
=========================================

Use spaces instead of tabs for indentation. The only exception is for
makefiles, in which tabs have a syntactic meaning different from
spaces.

Do not add trailing whitespace.

Sage provides editor configuration for Emacs, using the file
``.dir-locals.el``, to use spaces instead of tabs. Regarding trailing
whitespace, see https://www.emacswiki.org/emacs/DeletingWhitespace
for various solutions.

If you use another editor, we recommend to configure it so you do not
add tabs to files.


.. _chapter-picklejar:

The Pickle Jar
Expand Down

0 comments on commit 33ba206

Please sign in to comment.