[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Formalise the use of spaces rather than tabs
From: |
John Darrington |
Subject: |
[PATCH] Formalise the use of spaces rather than tabs |
Date: |
Sat, 23 May 2020 13:08:55 +0200 |
Mention in HACKING that we like spaces rather than tabs in our code, and add a
syntax-check for this. (This change doesn't fix the things that will cause
this test to fail!)
---
HACKING | 13 ++++++++++---
cfg.mk | 6 ++++++
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/HACKING b/HACKING
index cc524860..8329e371 100644
--- a/HACKING
+++ b/HACKING
@@ -59,9 +59,10 @@ along with GNU poke. If not, see
<https://www.gnu.org/licenses/>.
3.17 Continuous Integration
4 Coding Style and Conventions
4.1 Writing C
- 4.1.1 Avoid bool
- 4.1.2 Use _p for Predicates
- 4.1.3 Documenting Functions in Public Headers
+ 4.1.1 Avoid Tabs
+ 4.1.2 Avoid bool
+ 4.1.3 Use _p for Predicates
+ 4.1.4 Documenting Functions in Public Headers
4.2 Writing Poke
4.3 Writing RAS
5 Writing Tests
@@ -445,6 +446,12 @@ Additionally, we have a few conventions that we ask you to
follow when
hacking poke, in order to keep a coherent style when possible. These
are documented in the following subsections.
+Avoid Tabs
+..........
+
+Please format your code using spaces. Tabs (Ascii 9) should not
+appear anywhere except in Makefiles.
+
Avoid bool
..........
diff --git a/cfg.mk b/cfg.mk
index d2e6c122..dcce90d4 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -39,3 +39,9 @@ sc_unitalicised_etc:
exclude='@i{etc}' \
halt='found unitalicised "etc" in Texinfo source. Use @i{etc}' \
$(_sc_search_regexp)
+
+sc_tabs_in_source:
+ @prohibit=' ' \
+ in_vc_files='\.[chly]$$' \
+ halt='found tabs in source. Use spaces instead.' \
+ $(_sc_search_regexp)
--
2.20.1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] Formalise the use of spaces rather than tabs,
John Darrington <=