[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tlf-devel] code indenting?
From: |
Thomas Beierlein |
Subject: |
Re: [Tlf-devel] code indenting? |
Date: |
Sun, 28 Jan 2018 16:58:35 +0100 |
Hi all,
in meantime I did some checks about the impact of the suggested astyle
settings.
I must confess that I underestimated how many inconsistencies crept in.
The settings below have the smallest impact on the existing code and I
think they are a good start.
I did some statistics:
Total LOC of TLF project: ~36000
Changes: ~6000 lines
Out of these ~5000 are only whitespace changes
For a simple check do a clean checkout of master, apply astyle with the
settings and than do a 'git diff --stat' oder 'git diff -w --stat' for
the numbers. You can reset it with 'git reset --hard' to the starting
point.
If you have objections or comments to the styling rules below, please
respond. Otherwise I will imply the formatting changes around the end of
the coming week.
For the concrete meaning of the single keywords see
http://astyle.sourceforge.net/astyle.html
----
# astylerc--custom options for Tlf
# Java style formatting attaches opening braces
style=attach
# Indent with a width of 4 spaces. Use 8 space tabs characters if
# possible
indent=force-tab-x=8
indent=force-tab=4
# Remove extra space padding around parenthesis on the inside and
# outside.
unpad-paren
# Insert space padding around operators.
pad-oper
# Insert space padding after paren headers only (e.g. 'if', 'for',
# 'while'...).
pad-header
# Attach a pointer operator (*) to name (name) and reference operator
# (&) to type (type).
align-pointer=name
align-reference=type
# Don't break one-line blocks.
keep-one-line-blocks
# Don't break complex statements and multiple statements residing on a
# single line.
keep-one-line-statements
# try to shorten long lines to 80 characters
max-code-length=80
# Preserve the file date and time
preserve-date
# Do not make backups of the original file
suffix=none
----
73, de Tom.
--
"Do what is needful!"
Ursula LeGuin: Earthsea
--