Skip to content

[3.5] Sync up .clang-format with master, re-format the files again - #29822

Closed
esyr wants to merge 8 commits into
openssl:openssl-3.5from
esyr:esyr/clang-format-updates-3.5
Closed

esyr wants to merge 8 commits into
openssl:openssl-3.5from
esyr:esyr/clang-format-updates-3.5

Conversation

@esyr

@esyr esyr commented Jan 28, 2026

Copy link
Copy Markdown
Member

As revealed during the release process, not every file conforms to the current .clang-format configuration, which is combination of different configurations in different branches and some files not being re-formatted during commits. Try to address both of these issues.

@esyr esyr added approval: review pending This pull request needs review by a committer triaged: cleanup The issue/pr deals with cleanup of comments/docs not altering code significantly branch: 3.5 Applies to openssl-3.5 labels Jan 28, 2026
@github-actions github-actions Bot added the severity: fips change The pull request changes FIPS provider sources label Jan 28, 2026
@openssl-machine

Copy link
Copy Markdown
Collaborator

This PR is in a state where it requires action by @openssl/committers but the last update was 30 days ago

@openssl-machine

Copy link
Copy Markdown
Collaborator

This PR is in a state where it requires action by @openssl/committers but the last update was 61 days ago

@t8m t8m added triaged: bug The issue/pr is/fixes a bug tests: exempted The PR is exempt from requirements for testing labels Mar 31, 2026
t8m
t8m previously approved these changes Mar 31, 2026
@t8m
t8m requested a review from a team March 31, 2026 18:37
npajkovsky
npajkovsky previously approved these changes Apr 1, 2026
@openssl-machine openssl-machine added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels Apr 1, 2026
@esyr
esyr dismissed stale reviews from npajkovsky and t8m via 30a9063 April 1, 2026 08:27
@esyr
esyr force-pushed the esyr/clang-format-updates-3.5 branch from dc400fc to 30a9063 Compare April 1, 2026 08:27
@openssl-machine openssl-machine added approval: review pending This pull request needs review by a committer and removed approval: done This pull request has the required number of approvals labels Apr 1, 2026
esyr and others added 8 commits April 1, 2026 11:02
It is cherry-picked from commit 1afb05b "Add serialization for SHA-2
digest contexts" to ensure that .clang-format configuration are in sync
between branches.
This resulted in an adjustment of reformatting that is a bit less trippy
in some places.

Original-PR: openssl#29383
Original-Commit: 821b265 "Add a few more ASN.1 related StatementMacros"
This was done by calling a script I made on the spot:

    bash add-types-to-clang-format > .clang-format.new && mv .clang-format.new .clang-format

This is what that script looked like:

    #! /bin/bash

    sed -ne '1,/^CommentPragmas:/p' < .clang-format

    cat <<_____
    # OpenSSL uses typedefs extensively. Tell clang-format about them.
    TypeNames:
    _____

    include_re=$(yq -r '.repos.[].hooks.[] | select(.id == "clang-format") | .files' < .pre-commit-config.yaml)
    include_dirs=( apps crypto include providers ssl )
    git ls-files "${include_dirs[@]}" \
        | grep -E $include_re \
        | xargs ctags -f - \
        | awk -F "\t" -- '$2 ~ /\.h/ && $4 == "t" { printf "  - \"%s\"\n", $1 }' \
        | sort \
        | uniq

    cat <<_____
      # The following types are macros, and need to remain that way, unfortunately
      - "HASH_CTX"
      - "HASH_LONG"
      - "MD32_REG_T"
    _____

    sed -ne '/^# OpenSSL uses macros extensively/,$p' < .clang-format

Original-PR: openssl#29383
Original-Commit: aa9defa "Dump all known typedefs into .clang-format"
Original-PR: openssl#29383
Original-Commit: 16fa01b "Add a couple of DH related StatementMacros, and adjust"
Cherry-picked from commits d4c1efc "Remove dead EVP_aes_*() code"
and 32eaa74 "Cleanup block cipher macros in include/crypto/evp.h".
Anytime a new error code is added it generates error related files.
These are generated using a perl script which used readable indenting.
The indenting has been removed.

Original-PR: openssl#29631
Original-Commit: 8424f565dcbb "Make OpenSSL generated error files use the current clang-format."
…bjects.

Original-PR: openssl#29599
Original-Commit: a62d247 "Add clang-format file exclusions for generated files related to OBJ"
Original-Merge-Date: Tue Jan 13 10:13:37 2026
Ensure that all the source files are formatted with the current
.clang-format configuration, to avoid spurious clang-format checker
errors when arbitrary files are touched.

Signed-off-by: Eugene Syromiatnikov <[email protected]>
@esyr
esyr force-pushed the esyr/clang-format-updates-3.5 branch from 30a9063 to 43bbd00 Compare April 1, 2026 09:03
@esyr esyr moved this to Waiting Review in Development Board Apr 1, 2026
@openssl-machine openssl-machine added the approval: done This pull request has the required number of approvals label Apr 2, 2026
@github-project-automation github-project-automation Bot moved this from Waiting Review to Waiting Merge in Development Board Apr 2, 2026
@openssl-machine openssl-machine removed the approval: review pending This pull request needs review by a committer label Apr 2, 2026
@openssl-machine openssl-machine added approval: ready to merge The 24 hour grace period has passed, ready to merge and removed approval: done This pull request has the required number of approvals labels Apr 3, 2026
@openssl-machine

Copy link
Copy Markdown
Collaborator

This pull request is ready to merge

openssl-machine pushed a commit that referenced this pull request Apr 3, 2026
It is cherry-picked from commit 1afb05b "Add serialization for SHA-2
digest contexts" to ensure that .clang-format configuration are in sync
between branches.

Reviewed-by: Nikola Pajkovsky <[email protected]>
Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
MergeDate: Fri Apr  3 14:48:51 2026
(Merged from #29822)
openssl-machine pushed a commit that referenced this pull request Apr 3, 2026
This resulted in an adjustment of reformatting that is a bit less trippy
in some places.

Original-PR: #29383
Original-Commit: 821b265 "Add a few more ASN.1 related StatementMacros"

Reviewed-by: Nikola Pajkovsky <[email protected]>
Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
MergeDate: Fri Apr  3 14:48:52 2026
(Merged from #29822)
openssl-machine pushed a commit that referenced this pull request Apr 3, 2026
This was done by calling a script I made on the spot:

    bash add-types-to-clang-format > .clang-format.new && mv .clang-format.new .clang-format

This is what that script looked like:

    #! /bin/bash

    sed -ne '1,/^CommentPragmas:/p' < .clang-format

    cat <<_____
    # OpenSSL uses typedefs extensively. Tell clang-format about them.
    TypeNames:
    _____

    include_re=$(yq -r '.repos.[].hooks.[] | select(.id == "clang-format") | .files' < .pre-commit-config.yaml)
    include_dirs=( apps crypto include providers ssl )
    git ls-files "${include_dirs[@]}" \
        | grep -E $include_re \
        | xargs ctags -f - \
        | awk -F "\t" -- '$2 ~ /\.h/ && $4 == "t" { printf "  - \"%s\"\n", $1 }' \
        | sort \
        | uniq

    cat <<_____
      # The following types are macros, and need to remain that way, unfortunately
      - "HASH_CTX"
      - "HASH_LONG"
      - "MD32_REG_T"
    _____

    sed -ne '/^# OpenSSL uses macros extensively/,$p' < .clang-format

Original-PR: #29383
Original-Commit: aa9defa "Dump all known typedefs into .clang-format"

Reviewed-by: Nikola Pajkovsky <[email protected]>
Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
MergeDate: Fri Apr  3 14:48:54 2026
(Merged from #29822)
openssl-machine pushed a commit that referenced this pull request Apr 3, 2026
Original-PR: #29383
Original-Commit: 16fa01b "Add a couple of DH related StatementMacros, and adjust"

Reviewed-by: Nikola Pajkovsky <[email protected]>
Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
MergeDate: Fri Apr  3 14:48:55 2026
(Merged from #29822)
openssl-machine pushed a commit that referenced this pull request Apr 3, 2026
Cherry-picked from commits d4c1efc "Remove dead EVP_aes_*() code"
and 32eaa74 "Cleanup block cipher macros in include/crypto/evp.h".

Reviewed-by: Nikola Pajkovsky <[email protected]>
Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
MergeDate: Fri Apr  3 14:48:57 2026
(Merged from #29822)
openssl-machine pushed a commit that referenced this pull request Apr 3, 2026
Anytime a new error code is added it generates error related files.
These are generated using a perl script which used readable indenting.
The indenting has been removed.

Original-PR: #29631
Original-Commit: 8424f565dcbb "Make OpenSSL generated error files use the current clang-format."

Reviewed-by: Nikola Pajkovsky <[email protected]>
Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
MergeDate: Fri Apr  3 14:48:58 2026
(Merged from #29822)
openssl-machine pushed a commit that referenced this pull request Apr 3, 2026
…bjects.

Original-PR: #29599
Original-Commit: a62d247 "Add clang-format file exclusions for generated files related to OBJ"
Original-Merge-Date: Tue Jan 13 10:13:37 2026

Reviewed-by: Nikola Pajkovsky <[email protected]>
Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
MergeDate: Fri Apr  3 14:48:59 2026
(Merged from #29822)
openssl-machine pushed a commit that referenced this pull request Apr 3, 2026
Ensure that all the source files are formatted with the current
.clang-format configuration, to avoid spurious clang-format checker
errors when arbitrary files are touched.

Signed-off-by: Eugene Syromiatnikov <[email protected]>

Reviewed-by: Nikola Pajkovsky <[email protected]>
Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
MergeDate: Fri Apr  3 14:49:00 2026
(Merged from #29822)
@t8m

t8m commented Apr 3, 2026

Copy link
Copy Markdown
Member

Merged to the 3.5 branch. Thank you.

@t8m t8m closed this Apr 3, 2026
@github-project-automation github-project-automation Bot moved this from Waiting Merge to Done in Development Board Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval: ready to merge The 24 hour grace period has passed, ready to merge branch: 3.5 Applies to openssl-3.5 severity: fips change The pull request changes FIPS provider sources tests: exempted The PR is exempt from requirements for testing triaged: bug The issue/pr is/fixes a bug triaged: cleanup The issue/pr deals with cleanup of comments/docs not altering code significantly

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants