Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: Allow for a single commit in the --commits cmd-line param #412

Merged
merged 1 commit into from
Jan 16, 2023

Conversation

carlescufi
Copy link
Contributor

@carlescufi carlescufi commented Jan 16, 2023

In order to avoid applications needing to select between --commit and --commits based on the number of commits, allow for providing a single commit with --commits in the format:

$ gitlint --commits <sha>,

The trailing comma ensures that gitlint knows this is a commit list and not a refspec.

Signed-off-by: Carles Cufi carles.cufi@nordicsemi.no

@jorisroovers
Copy link
Owner

Thanks for the PR - makes sense 👍

Still needs docs and a unit test (I can take care of that for you if you want).

@carlescufi
Copy link
Contributor Author

Thanks for the PR - makes sense 👍

Still needs docs and a unit test (I can take care of that for you if you want).

Let me give it a go. If I get stuck I will let you know. Thanks!

In order to avoid applications needing to select between `--commit` and
`--commits` based on the number of commits, allow for providing a single
commit with `--commits` in the format:

$ gitlint --commits <sha>,

The trailing comma ensures that gitlint knows this is a commit list and
not a refspec.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
@carlescufi
Copy link
Contributor Author

@jorisroovers done, please take another look. Thanks!

krish2718 pushed a commit to krish2718/sdk-zephyr that referenced this pull request Jan 16, 2023
fixup! [nrf noup] ci: NCS-specific CI tweaks

When merging a single commit we should be using "--commit" option of
gitlint as per [1] from 0.9.0 "--commits" doesn't work for single commit
causing gitlint to lint all commits in the repo.

FYI, [2] fixes this issue, but it is not merged yet.

[1] - https://github.com/jorisroovers/gitlint/blob/main/CHANGELOG.md#v090-2017-12-03
[2] - jorisroovers/gitlint#412

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
carlescufi pushed a commit to nrfconnect/sdk-zephyr that referenced this pull request Jan 16, 2023
fixup! [nrf noup] ci: NCS-specific CI tweaks

When merging a single commit we should be using "--commit" option of
gitlint as per [1] from 0.9.0 "--commits" doesn't work for single commit
causing gitlint to lint all commits in the repo.

FYI, [2] fixes this issue, but it is not merged yet.

[1] - https://github.com/jorisroovers/gitlint/blob/main/CHANGELOG.md#v090-2017-12-03
[2] - jorisroovers/gitlint#412

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
@jorisroovers
Copy link
Owner

Tested locally, works well!

Merging 👍

@jorisroovers jorisroovers merged commit 3c36695 into jorisroovers:main Jan 16, 2023
@carlescufi
Copy link
Contributor Author

Tested locally, works well!

Merging 👍

Thanks for the speedy review and merging!

de-nordic pushed a commit to nrfconnect/sdk-zephyr that referenced this pull request Jan 17, 2023
fixup! [nrf noup] ci: NCS-specific CI tweaks

When merging a single commit we should be using "--commit" option of
gitlint as per [1] from 0.9.0 "--commits" doesn't work for single commit
causing gitlint to lint all commits in the repo.

FYI, [2] fixes this issue, but it is not merged yet.

[1] - https://github.com/jorisroovers/gitlint/blob/main/CHANGELOG.md#v090-2017-12-03
[2] - jorisroovers/gitlint#412

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
jorisroovers added a commit that referenced this pull request Mar 7, 2023
This release was primarily focussed on modernizing gitlint's build and test
tooling (details: #378).

General

    Python 3.6 no longer supported (EOL since 2021-12-23) (#379)
    This is the last release to support the sh library (used under-the-hood to
    execute git commands) by setting GITLINT_USE_SH_LIB=1. This is already
    disabled by default since v0.18.0.

Features

    Allow for a single commit in the --commits cmd-line param (#412)
    Gitlint now separates FILE_ENCODING (always UTF-8) from TERMINAL_ENCODING
    (terminal dependent), this should improve issues with unicode. Use
    gitlint --debug to inspect these values. (#424)

Bugfixes

    ignore-by-author-name crashes without --staged (#445)
    Various documentation fixes (#401, #433) - Thanks scop

Development

    Adopted hatch for project management (#384). This significantly improves
    the developer workflow, please read the updated CONTRIBUTING page.
    Adopted ruff for linting, replacing pylint (#404)
    Gitlint now publishes dev builds on every commit to main (#429)
    Gitlint now publishes a latest_dev docker image on every commit to
    main (#451) (#452)
    Dependencies updated
    Many improvements to the CI/CD worfklows
    Improve unit test coverage (#453)
    Integration test fixes on windows (#392, #397)
    Devcontainer improvements (#428)
    Removal of Dockerfile.dev (#390)
    Fix most integration tests on Windows
    Fix Windows unit tests (#383)
    Introduce a gate/check GHA job (#375)

Full Release details in CHANGELOG.md.
jorisroovers added a commit that referenced this pull request Mar 7, 2023
This release was primarily focussed on modernizing gitlint's build and test
tooling (details: #378).

General

    Python 3.6 no longer supported (EOL since 2021-12-23) (#379)
    This is the last release to support the sh library (used under-the-hood to
    execute git commands) by setting GITLINT_USE_SH_LIB=1. This is already
    disabled by default since v0.18.0.

Features

    Allow for a single commit in the --commits cmd-line param (#412)
    Gitlint now separates FILE_ENCODING (always UTF-8) from TERMINAL_ENCODING
    (terminal dependent), this should improve issues with unicode. Use
    gitlint --debug to inspect these values. (#424)

Bugfixes

    ignore-by-author-name crashes without --staged (#445)
    Various documentation fixes (#401, #433) - Thanks scop

Development

    Adopted hatch for project management (#384). This significantly improves
    the developer workflow, please read the updated CONTRIBUTING page.
    Adopted ruff for linting, replacing pylint (#404)
    Gitlint now publishes dev builds on every commit to main (#429)
    Gitlint now publishes a latest_dev docker image on every commit to
    main (#451) (#452)
    Dependencies updated
    Many improvements to the CI/CD worfklows
    Improve unit test coverage (#453)
    Integration test fixes on windows (#392, #397)
    Devcontainer improvements (#428)
    Removal of Dockerfile.dev (#390)
    Fix most integration tests on Windows
    Fix Windows unit tests (#383)
    Introduce a gate/check GHA job (#375)

Full Release details in CHANGELOG.md.
@jorisroovers jorisroovers added this to the 0.19.0 milestone Mar 9, 2023
carlescufi added a commit to carlescufi/zephyr that referenced this pull request Jul 28, 2023
fixup! [nrf noup] ci: NCS-specific CI tweaks

Now that gitlint supports --commits with a single commit natively,
remove the extra logic.

jorisroovers/gitlint#412

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
carlescufi added a commit to carlescufi/sdk-zephyr that referenced this pull request Jul 28, 2023
fixup! [nrf noup] ci: NCS-specific CI tweaks

- Now that gitlint supports --commits with a single commit natively,
remove the extra logic: jorisroovers/gitlint#412

- Fix gitlint ncs extension matching logic: the group was wrong (group 1
  is the Revert, group 2 is the actual sauce tag).

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
carlescufi added a commit to nrfconnect/sdk-zephyr that referenced this pull request Jul 28, 2023
fixup! [nrf noup] ci: NCS-specific CI tweaks

- Now that gitlint supports --commits with a single commit natively,
remove the extra logic: jorisroovers/gitlint#412

- Fix gitlint ncs extension matching logic: the group was wrong (group 1
  is the Revert, group 2 is the actual sauce tag).

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants