public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Farre <simon.farre.cx@gmail.com>
To: gdb-patches@sourceware.org
Subject: [Note] Patches not sent to list
Date: Tue, 20 Jun 2023 20:53:08 +0200	[thread overview]
Message-ID: <2692b7a4-1c99-385a-d9dc-28ff38c37992@gmail.com> (raw)

Two patches were pushed to the repo that did not get sent to the list. 
These only included formatting changes from black.

d32d7e918de - Fixes 28ab59607ef40b9571c0702ffba8f6aa6fb1b033

and

ce65796b17d - Fixes f1a614dc8f015743e9fe7fe5f3f019303f8db718

Sorry about that, won't happen again.

For posterity, here's a pre-commit hook that will save future 
contributors from these kinds of problems;

#
# Pre-commit hook file
#

binutils_root=`git rev-parse --show-toplevel`
# Verify that changed python files are properly formatted
files=`exec git diff --cached --name-only`

failed_check=()
has_failure=0
while IFS= read -r file_path; do

     file_ext="${file_path##*.}"

     # We only want to run black on python files
     if [[ "$file_ext" == "py" ]]; then
         black --check "$binutils_root/$file_path" >/dev/null 2>&1
         exit_code=$?
         if [[ "$exit_code" -ne 0 ]]; then
           failed_check+=("$file_path")
           has_failure=1
         fi
     fi
done <<< "$files"

if [[ "$has_failure" -eq 1 ]]; then
   echo "You need to format these files using black"
   for file in "${failed_check[@]}"; do
     echo "  $file"
   done
   exit 1
fi

exit 0

Regards,
Simon


                 reply	other threads:[~2023-06-20 18:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2692b7a4-1c99-385a-d9dc-28ff38c37992@gmail.com \
    --to=simon.farre.cx@gmail.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).