zenoh icon indicating copy to clipboard operation
zenoh copied to clipboard

Automatic Generation of License Headers

Open YuanYuYuan opened this issue 10 months ago • 4 comments

At first, I've tried with skywalking-eyes developed by Apache. But it turns out to be too slow to generate the header. Then hawkeye from the greptime was tested and ran fluently. It's quite slim and extensible to use. And the check is fast enough to be integrated into CI.

YuanYuYuan avatar Apr 22 '24 07:04 YuanYuYuan

An example workflow to automatize the license header fix.

on: push
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          # To work with PR.
          # See https://github.com/EndBug/add-and-commit?tab=readme-ov-file#working-with-prs
          repository: ${{ github.event.pull_request.head.repo.full_name }}
          ref: ${{ github.event.pull_request.head.ref }}

      - name: Check License Header
        uses: korandoru/hawkeye@v5
        with:
          mode: format
        # Workaround: hawkeye uses the inappropriate logging level.
        continue-on-error: true

      - uses: EndBug/add-and-commit@v9
        with:
          committer_name: eclipse-zenoh-bot
          committer_email: [email protected]

A manual check is still needed as the feature of publication year is still missing. See https://github.com/korandoru/hawkeye/issues/114

YuanYuYuan avatar Apr 22 '24 09:04 YuanYuYuan

I think the workflow should be added to eclipse-zenoh/ci instead of eclipse-zenoh/zenoh. @fuzzypixelz ?

Mallets avatar Apr 22 '24 10:04 Mallets

@diogomatsubara could please have a look at this PR?

Mallets avatar May 28 '24 13:05 Mallets

@Mallets sure thing. I'll add the workflow to the CI repository and then enable them for the zenoh-* repos.

diogomatsubara avatar May 29 '24 15:05 diogomatsubara