Skip to content

Checking 4 spaces indent in C files in CI #975

@junaruga

Description

@junaruga

Seeing the PR #973 (thanks for the PR!), I am considering if we can check if the indent is 4 spaces without tabs in CI. Right now I am seeing the following tools.

If we only check if C files don't include tabs. We may just apply the following kind of script.

$ cat check_no_tab.sh
#!/bin/bash

set -eu

if grep -rPn '\t' ext/openssl/; then
    echo "FAIL"
    exit 1
fi

echo "OK"
exit 0

OK case:

$ ./check_no_tab.sh
OK

Error case:

$ ./check_no_tab.sh
ext/openssl/ossl_ssl.c:3302:	DefIVarID(hostname);
FAIL

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions