qemu-devel
[Top][All Lists]
Advanced

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

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


From: Stefan Hajnoczi
Subject: Re: Exclude paths from checkpatch (was: Re: [PATCH] Add minimal Hexagon target)
Date: Tue, 19 Nov 2019 16:14:34 +0000
User-agent: Mutt/1.12.1 (2019-06-15)

On Tue, Nov 19, 2019 at 09:51:00AM +0100, Philippe Mathieu-Daudé wrote:
> 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

Seems useful so that patchew/checkpatch output remains high-quality.

An alternative to the git exclude pathspec trick is to build
.checkpatchignore into the checkpatch.pl script so that regular
invocations also use .checkpatchignore.

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

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