Skip to main content
  • Home
  • login
  • Browse the archive

    swh mirror partner logo
swh logo
SoftwareHeritage
Software
Heritage
Mirror
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • 59e02e5
  • /
  • .github
  • /
  • workflows
  • /
  • style-checks.yml
Raw File
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:69c9ca6c8ef6261b8a6595c1166988715f103627
directory badge Iframe embedding
swh:1:dir:f5373687d74f64458f7b4d1eaf0b281dc54a6a4d
style-checks.yml
# Copyright 2021-2024 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License").  You may not use
# this file except in compliance with the License.  You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html

name: Coding style validation 

on: [pull_request]

env:
  PR_NUMBER: ${{ github.event.number }}
  GH_TOKEN: ${{ github.token }}

permissions:
  contents: read

jobs:
  check-style:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
      with:
        fetch-depth: 0
        path: openssl
    - name: check style for each commit 
      working-directory: openssl
      shell: bash
      run: |
        ERRORS_FOUND=0
        git fetch origin $GITHUB_BASE_REF:$GITHUB_BASE_REF
        REFSTART=$(git rev-parse $GITHUB_BASE_REF)
        REFEND=$(git rev-parse HEAD)
        echo "Checking from $REFSTART to $REFEND"
        echo "::group::Style report for commits $REFSTART..$REFEND"
        set +e
        ./util/check-format-commit.sh $REFSTART..$REFEND
        if [ $? -ne 0 ]
        then
          ERRORS_FOUND=1
        fi
        set -e
        echo "::endgroup::"
        SKIP_TEST=$(gh pr view $PR_NUMBER --json labels --jq '.labels[] | select(.name == "style: waived") | .name')
        if [ -z "$SKIP_TEST" ]
        then
          exit $ERRORS_FOUND
        else
          echo "PR $PR_NUMBER is marked with style: waived, waiving style check errors"
          exit 0
        fi

ENEA — Copyright (C), ENEA. License: GNU AGPLv3+.
Legal notes  ::  JavaScript license information ::  Web API

back to top