ruby / ruby/openssl

Checking 4 spaces indent in C files in CI

Open
#975 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
276
Forks
200
Avg merge
1d 19h
Merged PRs (30d)
7

Description

Seeing the PR https://github.com/ruby/openssl/pull/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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the CI setup and the C sources under ext/openssl/, using the proposed check_no_tab.sh pattern as the starting point. Confirm the check reports tab-containing lines and passes when no tabs are present; done means the check runs in CI for the C files.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, c
Domain
ci-cd
Issue type
Feature
Difficulty
2/5
Estimated time
Half a day
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.