[bug#55693,v2,2/2] gnu: Add gitlint.
Commit Message
* gnu/packages/version-control.scm (gitlint): New variable.
---
gnu/packages/version-control.scm | 39 ++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
Comments
Brian Kubisiak schreef op ma 30-05-2022 om 16:17 [-0700]:
> + #t)))))
Trailing #t aren't required anymore since a long time, it can be
removed.
> + (inputs
> + `(("git" ,git)
> + ("python-arrow" ,python-arrow)
> + ("python-click" ,python-click)
> + ("python-sh" ,python-sh)))
Input labels aren't required anymore. Try running "guix style -S
inputs". Also, IIUC, Hartmut Goebel would prefer not using quasiquote
(`):
(arguments
(list #:phases
#~(modify-phases [stuff]
[stuff]
...)))
to avoid the complicated quasiquote/unquote construct, with which I
agree though it's AFAIK not (yet?) elevated to ‘official Guix style’ or
such.
Otherwise LGTM, though I haven't looked at most of the source code of
gitlint (for malware or such) or in detail at the description and
synopsis (for clarity and such).
Greetings,
Maxime.
Hi,
Maxime Devos <maximedevos@telenet.be> skribis:
> Input labels aren't required anymore. Try running "guix style -S
> inputs". Also, IIUC, Hartmut Goebel would prefer not using quasiquote
> (`):
>
> (arguments
> (list #:phases
> #~(modify-phases [stuff]
> [stuff]
> ...)))
>
> to avoid the complicated quasiquote/unquote construct, with which I
> agree though it's AFAIK not (yet?) elevated to ‘official Guix style’ or
> such.
I too prefer:
(list #:foo #~(…))
over:
`(#:foo ,#~(…))
Otherwise that’s too much line noise IMO, especially for a newcomer.
Ludo’.
@@ -3371,3 +3371,42 @@ (define-public git-filter-repo
Git project instead of @command{git filter-branch}.")
(license (list license:expat ;; Main license.
license:gpl2)))) ;; For test harness.
+
+(define-public gitlint
+ (package
+ (name "gitlint")
+ (version "0.17.0")
+ (source (origin
+ (method url-fetch)
+ ;; the gitlint-core pypi package contains the actual gitlint
+ ;; code; the gitlint package only pulls in gitlint-core with
+ ;; stricter dependency versioning
+ (uri (pypi-uri "gitlint-core" version))
+ (sha256
+ (base32
+ "14cn89biys8r7mwcdgllv371k34km9k1941ylxf53a7sxwrzsbbp"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'loosen-requirements
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "gitlint/shell.py"
+ (("'git'") (string-append "'"
+ (search-input-file inputs "bin/git")
+ "'"))
+ ;; force using subprocess instead of sh so git does not need to
+ ;; be a propagated input
+ (("if USE_SH_LIB") "if False"))
+ #t)))))
+ (inputs
+ `(("git" ,git)
+ ("python-arrow" ,python-arrow)
+ ("python-click" ,python-click)
+ ("python-sh" ,python-sh)))
+ (home-page "https://jorisroovers.com/gitlint/")
+ (synopsis "Linting for your git commit messages")
+ (description
+ "Gitlint is a git commit message linter written in python: it checks your
+commit messages for style.")
+ (license license:expat)))