qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Exclude paths from checkpatch (was: Re: [PATCH] Add minimal Hexagon targ


From: Philippe Mathieu-Daudé
Subject: Exclude paths from checkpatch (was: Re: [PATCH] Add minimal Hexagon target)
Date: Tue, 19 Nov 2019 09:51:00 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1

On 11/19/19 2:31 AM, address@hidden wrote:
Patchew URL: https://patchew.org/QEMU/address@hidden/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [PATCH] Add minimal Hexagon target - First in a series of patches - 
linux-user changes + linux-user/hexagon + skeleton of target/hexagon - Files in 
target/hexagon/imported are from another project and therefore do not conform 
to qemu coding standards
Type: series
Message-id: address@hidden

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Switched to a new branch 'test'
7744509 Add minimal Hexagon target - First in a series of patches - linux-user 
changes + linux-user/hexagon + skeleton of target/hexagon - Files in 
target/hexagon/imported are from another project and therefore do not conform 
to qemu coding standards

=== OUTPUT BEGIN ===
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#38:
new file mode 100644

ERROR: do not use C99 // comments
#1922: FILE: target/hexagon/imported/iss_ver_registers.h:80:
+// New interrupts, keep old defines for the time being

I tried this quick way to filter some file/directory out of checkpatch.pl, and it works nicely:

$ cat .git/hooks/pre-commit
#!/bin/bash
exec git diff --cached -- ':(top)' $(test -e .checkpatchignore && sed -ne '/^\(#.*\|$\)/ ! s/.*/:(exclude)\0/p' < .checkpatchignore) | scripts/checkpatch.pl --no-signoff -q -

$ cat .checkpatchignore
# A line starting with # serves as a comment.
# A blank line matches no files, so it can serve as a separator for readability.
include/standard-headers
target/xtensa/core-*
target/hexagon/imported

Would this be acceptable to reduce patchew false positives?

git exclude pathspec trick from:
https://stackoverflow.com/questions/39931781/git-diff-stat-exclude-certain-files/39937070#39937070




reply via email to

[Prev in Thread] Current Thread [Next in Thread]