git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] ci: fix inconsistent indentation

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 10, 2020, 16:29 UTC
Message-ID
<xmqq5z9qcvlt.fsf@gitster.c.googlers.com>
In-Reply-To
<pull.823.git.git.1597048659983.gitgitgadget@gmail.com>
"Adrian via GitGitGadget" <gitgitgadget@gmail.com> writes:
> From: Adrian Moennich <adrian@planetcoding.net>
>

Here is a good place to explain what you consider consistent and inconsistent ...

> Signed-off-by: Adrian Moennich <adrian@planetcoding.net>
> ---
... because ...
Show 7 quoted lines
>  jobs:
>    ci-config:
> -      runs-on: ubuntu-latest
> -      outputs:
> -        enabled: ${{ steps.check-ref.outputs.enabled }}
> -      steps:
> -        - name: try to clone ci-config branch

... the above is being very consistent. All the direct children of jobs.ci-config like runs-on, outputs and steps are (1) indented more than its parent (i.e. jobs.ci-config) and (2) indented by the same amount relative to their parent (i.e. 4 spaces).

Apparently, that is enough "consistency" CI system wants to see. If you want to impose extra "consistency", that is fine, but you'd need to be more explicit about it. Perhaps like

    All other parts of this file indent children from their parent
    by exactly two spaces, but direct children of "jobs.ci-config"
    hierarchy were indented by four spaces.  While it is not an
    error, let's be more consistent.
or something?
Show 56 quoted lines
> -          continue-on-error: true
> -          run: |
> -            git -c protocol.version=2 clone \
> -              --no-tags \
> -              --single-branch \
> -              -b ci-config \
> -              --depth 1 \
> -              --no-checkout \
> -              --filter=blob:none \
> -              https://github.com/${{ github.repository }} \
> -              config-repo &&
> -              cd config-repo &&
> -              git checkout HEAD -- ci/config
> -        - id: check-ref
> -          name: check whether CI is enabled for ref
> -          run: |
> -            enabled=yes
> -            if test -x config-repo/ci/config/allow-ref &&
> -               ! config-repo/ci/config/allow-ref '${{ github.ref }}'
> -            then
> -              enabled=no
> -            fi
> -            echo "::set-output name=enabled::$enabled"
> +    runs-on: ubuntu-latest
> +    outputs:
> +      enabled: ${{ steps.check-ref.outputs.enabled }}
> +    steps:
> +      - name: try to clone ci-config branch
> +        continue-on-error: true
> +        run: |
> +          git -c protocol.version=2 clone \
> +            --no-tags \
> +            --single-branch \
> +            -b ci-config \
> +            --depth 1 \
> +            --no-checkout \
> +            --filter=blob:none \
> +            https://github.com/${{ github.repository }} \
> +            config-repo &&
> +            cd config-repo &&
> +            git checkout HEAD -- ci/config
> +      - id: check-ref
> +        name: check whether CI is enabled for ref
> +        run: |
> +          enabled=yes
> +          if test -x config-repo/ci/config/allow-ref &&
> +             ! config-repo/ci/config/allow-ref '${{ github.ref }}'
> +          then
> +            enabled=no
> +          fi
> +          echo "::set-output name=enabled::$enabled"
>  
>    windows-build:
>      needs: ci-config
>
> base-commit: dc04167d378fb29d30e1647ff6ff51dd182bc9a3
Previous: Adrian via GitGitGadgetNext: Adrian via GitGitGadget
Message 2 of 4 in “ci: fix inconsistent indentation”
  1. ci: fix inconsistent indentationAdrian via GitGitGadget, Aug 10, 2020
  2. Junio C HamanoAug 10, 2020
  3. ci: fix inconsistent indentationAdrian via GitGitGadget, Aug 21, 2020
  4. Junio C HamanoAug 21, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.