Subject: [bug#44913] [PATCH] gnu: ruby-rubocop-ast: Update to 1.2.0.

From: Leo Famulari <[email-masked]>
Date: Fri, 4 Dec 2020 19:01:33 -0500

On Fri, Nov 27, 2020 at 11:22:44PM +0100, Tomás Ortín Fernández via Guix-patches via wrote:
> * gnu/packages/ruby.scm (ruby-rubocop-ast): Update to 1.2.0.

Thanks!

>      (source
>       (origin
> -       (method git-fetch)               ;no test suite in distributed gem
> -       (uri (git-reference
> -             (url "https://github.com/rubocop-hq/rubocop-ast")
> -             (commit (string-append "v" version))))
> -       (file-name (git-file-name name version))
> +       (method url-fetch)
> +       (uri (rubygems-uri "rubocop-ast" version))
>         (sha256
>          (base32
> -         "1ycf6qcj8nbzk2js72priim4642lkn56w5kbny1nlryjkckxgm04"))))
> +         "0q0kdi89ad7dd1xmzrdf5ikk32bllzr68hf4x8fd7azcv5jnch2l"))))
>      (build-system ruby-build-system)
>      (arguments
> -     `(#:test-target "spec"
> -       #:phases (modify-phases %standard-phases
> -                  (add-after 'unpack 'disable-bundler
> -                    (lambda _
> -                      (substitute* "Rakefile"
> -                        (("Bundler\\.setup.*") "nil\n"))
> -                      #t))
> -                  (replace 'replace-git-ls-files
> -                    (lambda _
> -                      (substitute* "rubocop-ast.gemspec"
> -                        (("`git ls-files(.*)`" _ files)
> -                         (format #f "`find ~a -type f| sort`" files)))
> -                      #t)))))
> +     '(#:tests? #f)) ; tests not included in gem

The commit message should describe the changes to the code.

For example, I might write it this way:

------
gnu: ruby-rubocop-ast: Update to 1.2.0.

* gnu/packages/ruby.scm (ruby-rubocop-ast): Update to 1.2.0.
[source]: Fetch source from rubygems.
[arguments]: Remove obsolete 'disable-bundler' phase. Skip the test suite.
------

This helps communicate your intentions to reviewers (and everyone else).

For example, why does the patch remove the 'disable-bundler' phase? If that
phase is no longer needed, it helps to describe it as obsolete in the commit
message.

The code comment about why the tests are skipped is really useful, for the same
reason. But we can't add comments about code that is removed :)

Does that make sense? Can you send a revised patch with a complete commit
message? It's fine to copy what I wrote if it is accurate.