[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Wget-dev] wget2 | WIP: Use GNU Indent (!370)

From: Tim Rühsen
Subject: Re: [Wget-dev] wget2 | WIP: Use GNU Indent (!370)
Date: Wed, 08 May 2019 14:38:33 +0000

Ok, starting with the basics:
- tabs for indentation, spaces for alignment
- line length max. 120 chars (exceptions for readability)
- Unix style linebreaks (just linefeed '\n')
- tab width recommendation: 3 or 4
- single line comments start with //

More rules are tedious to write down, at least nothing that I would like to do.

For contributors we can just formulate a basic set of (non-obvious ?) rules and 
everything else is taken from the surrounding/existing code. We shouldn't be 
too nitpicking to not repel newcomers.
We also have lot's of style exceptions to increase human readability.

So I'm not sure about automatic beautifying yet.

Example code
#ifdef A
#       ifdef B
#               include <x.h>
#       endif

        method(const char *s, int i) FUNCTION_ATTRIBUTE;

struct A {

int method(const char *s, int i)
        if (i == 1)
                s = "foo"; // default

        switch (i) {
        case 0:
                s = "none";
                goto label;

        printf("s=%s\n", s);

        return 0;

Currently my `.indent_pro` has

Reply to this email directly or view it on GitLab: 
You're receiving this email because of your account on gitlab.com.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]