LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [Proposal] end of file checks by checkpatch.pl
@ 2019-05-09 15:27 Masahiro Yamada
  2019-05-09 17:19 ` Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Masahiro Yamada @ 2019-05-09 15:27 UTC (permalink / raw)
  To: Joe Perches; +Cc: Linux Kernel Mailing List, Andy Whitcroft

Hi Joe,


Does it make sense to check the following
by checkpatch.pl ?


[1] blank line at end of file

[2] no new line at end of file



When I apply a patch,
I sometimes see the following warning from 'git am'.


Applying: kunit: test: add string_stream a std::stream like string builder
.git/rebase-apply/patch:223: new blank line at EOF.
+


I just thought it could be checked
before the patch submission.


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Proposal] end of file checks by checkpatch.pl
  2019-05-09 15:27 [Proposal] end of file checks by checkpatch.pl Masahiro Yamada
@ 2019-05-09 17:19 ` Joe Perches
  2019-05-13 10:11   ` Masahiro Yamada
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2019-05-09 17:19 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Linux Kernel Mailing List, Andy Whitcroft

On Fri, 2019-05-10 at 00:27 +0900, Masahiro Yamada wrote:
> Hi Joe,
> 
> 
> Does it make sense to check the following
> by checkpatch.pl ?
> 
> 
> [1] blank line at end of file


> [2] no new line at end of file

I'm pretty sure checkpatch does one this already.
(around line 3175)

# check for adding lines without a newline.
		if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) {
 			WARN("MISSING_EOF_NEWLINE",
 			     "adding a line without newline at end of file\n" . $herecurr);
 		}


> When I apply a patch,
> I sometimes see the following warning from 'git am'.
> 
> 
> Applying: kunit: test: add string_stream a std::stream like string builder
> .git/rebase-apply/patch:223: new blank line at EOF.
> +
> 
> 
> I just thought it could be checked
> before the patch submission.

perhaps:
---
 scripts/checkpatch.pl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 1c421ac42b07..ceb32c584ee5 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3356,6 +3356,12 @@ sub process {
 			$last_blank_line = $linenr;
 		}
 
+# check the last line isn't blank
+		if ($linenr >= $#rawlines && $line =~ /^\+\s*$/) {
+			WARN("LINE_SPACING",
+			     "Avoid blank lines at EOF\n" . $herecurr);
+		}
+
 # check for missing blank lines after declarations
 		if ($sline =~ /^\+\s+\S/ &&			#Not at char 1
 			# actual declarations



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Proposal] end of file checks by checkpatch.pl
  2019-05-09 17:19 ` Joe Perches
@ 2019-05-13 10:11   ` Masahiro Yamada
  2019-05-13 15:51     ` Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Masahiro Yamada @ 2019-05-13 10:11 UTC (permalink / raw)
  To: Joe Perches; +Cc: Linux Kernel Mailing List, Andy Whitcroft

Hi Joe,

On Fri, May 10, 2019 at 2:20 AM Joe Perches <joe@perches.com> wrote:
>
> On Fri, 2019-05-10 at 00:27 +0900, Masahiro Yamada wrote:
> > Hi Joe,
> >
> >
> > Does it make sense to check the following
> > by checkpatch.pl ?
> >
> >
> > [1] blank line at end of file
>
>
> > [2] no new line at end of file
>
> I'm pretty sure checkpatch does one this already.
> (around line 3175)
>
> # check for adding lines without a newline.
>                 if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) {
>                         WARN("MISSING_EOF_NEWLINE",
>                              "adding a line without newline at end of file\n" . $herecurr);
>                 }


I did not know this. Thanks.

Looks like the report depends on the file type.

scripts/checkpatch.pl  -f  arch/sparc/lib/NG4clear_page.S
scripts/checkpatch.pl  -f  tools/power/cpupower/bench/cpufreq-bench_plot.sh

reported it, but

scripts/checkpatch.pl  -f  drivers/media/dvb-frontends/cxd2880/Kconfig
scripts/checkpatch.pl  -f  drivers/parport/Makefile

did not.

>
> > When I apply a patch,
> > I sometimes see the following warning from 'git am'.
> >
> >
> > Applying: kunit: test: add string_stream a std::stream like string builder
> > .git/rebase-apply/patch:223: new blank line at EOF.
> > +
> >
> >
> > I just thought it could be checked
> > before the patch submission.
>
> perhaps:
> ---
>  scripts/checkpatch.pl | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 1c421ac42b07..ceb32c584ee5 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3356,6 +3356,12 @@ sub process {
>                         $last_blank_line = $linenr;
>                 }
>
> +# check the last line isn't blank
> +               if ($linenr >= $#rawlines && $line =~ /^\+\s*$/) {
> +                       WARN("LINE_SPACING",
> +                            "Avoid blank lines at EOF\n" . $herecurr);
> +               }
> +
>  # check for missing blank lines after declarations
>                 if ($sline =~ /^\+\s+\S/ &&                     #Not at char 1
>                         # actual declarations
>
>

Worked for me.
(but Makefile, Kconfig were not checked though)


Could you commit it ?

Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Thanks.

-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Proposal] end of file checks by checkpatch.pl
  2019-05-13 10:11   ` Masahiro Yamada
@ 2019-05-13 15:51     ` Joe Perches
  2019-05-13 23:46       ` Masahiro Yamada
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2019-05-13 15:51 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Linux Kernel Mailing List, Andy Whitcroft

On Mon, 2019-05-13 at 19:11 +0900, Masahiro Yamada wrote:
> Hi Joe,

Hello again.

> On Fri, May 10, 2019 at 2:20 AM Joe Perches <joe@perches.com> wrote:
> > On Fri, 2019-05-10 at 00:27 +0900, Masahiro Yamada wrote:
> > > Does it make sense to check the following
> > > by checkpatch.pl ?
> > > [1] blank line at end of file
> > > [2] no new line at end of file
> > 
> > I'm pretty sure checkpatch does one this already.
[]
> Looks like the report depends on the file type.
> 
> scripts/checkpatch.pl  -f  arch/sparc/lib/NG4clear_page.S
> scripts/checkpatch.pl  -f  tools/power/cpupower/bench/cpufreq-bench_plot.sh
> 
> reported it, but
> 
> scripts/checkpatch.pl  -f  drivers/media/dvb-frontends/cxd2880/Kconfig
> scripts/checkpatch.pl  -f  drivers/parport/Makefile
> 
> did not.

Yes, this check is after a test for filename extension.

Currently the only file types it reports as missing an EOF
newline are done on files with the following extensions:

	.h
	.c
	.s
	.S
	.sh
	.dtsi
	.dts

So the existing test is not done on many file types.
The same file types are used for the proposed patch.

It's possible to have the existing missing newline at EOF
test and the proposed test for a blank line at EOF to be
done on all file types.

Is this reasonable or could it cause some other issue
for any other file types?  Should _any_ file extension
be excluded?

I believe not, but perhaps it's best to ask.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Proposal] end of file checks by checkpatch.pl
  2019-05-13 15:51     ` Joe Perches
@ 2019-05-13 23:46       ` Masahiro Yamada
  2019-05-13 23:58         ` Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Masahiro Yamada @ 2019-05-13 23:46 UTC (permalink / raw)
  To: Joe Perches; +Cc: Linux Kernel Mailing List, Andy Whitcroft

Hi Joe,

On Tue, May 14, 2019 at 4:23 AM Joe Perches <joe@perches.com> wrote:
>
> On Mon, 2019-05-13 at 19:11 +0900, Masahiro Yamada wrote:
> > Hi Joe,
>
> Hello again.
>
> > On Fri, May 10, 2019 at 2:20 AM Joe Perches <joe@perches.com> wrote:
> > > On Fri, 2019-05-10 at 00:27 +0900, Masahiro Yamada wrote:
> > > > Does it make sense to check the following
> > > > by checkpatch.pl ?
> > > > [1] blank line at end of file
> > > > [2] no new line at end of file
> > >
> > > I'm pretty sure checkpatch does one this already.
> []
> > Looks like the report depends on the file type.
> >
> > scripts/checkpatch.pl  -f  arch/sparc/lib/NG4clear_page.S
> > scripts/checkpatch.pl  -f  tools/power/cpupower/bench/cpufreq-bench_plot.sh
> >
> > reported it, but
> >
> > scripts/checkpatch.pl  -f  drivers/media/dvb-frontends/cxd2880/Kconfig
> > scripts/checkpatch.pl  -f  drivers/parport/Makefile
> >
> > did not.
>
> Yes, this check is after a test for filename extension.
>
> Currently the only file types it reports as missing an EOF
> newline are done on files with the following extensions:
>
>         .h
>         .c
>         .s
>         .S
>         .sh
>         .dtsi
>         .dts
>
> So the existing test is not done on many file types.
> The same file types are used for the proposed patch.
>
> It's possible to have the existing missing newline at EOF
> test and the proposed test for a blank line at EOF to be
> done on all file types.
>
> Is this reasonable or could it cause some other issue
> for any other file types?


I do not know cases where missing newline at EOF
or blank line at EOF is useful.

(Even if there are some, checkpatch.pl is allowed
to report false positives in my opinion.)


So, I think these two checks can be done for
all file types.


Currently, the following is the list of
missing newline at EOF.

checkpatch.pl misses to report most of them.
(the majority of the warning source is *.json)


./arch/arm/boot/dts/vexpress-v2m.dtsi
./arch/sparc/lib/NG4clear_page.S
./Documentation/ABI/testing/sysfs-bus-iio-dfsdm-adc-stm32
./Documentation/ABI/testing/sysfs-class-leds-gt683r
./Documentation/ABI/testing/sysfs-power
./Documentation/devicetree/bindings/ipmi/npcm7xx-kcs-bmc.txt
./Documentation/devicetree/bindings/pinctrl/nuvoton,npcm7xx-pinctrl.txt
./Documentation/devicetree/bindings/regulator/pv88060.txt
./Documentation/devicetree/bindings/sound/cs42l73.txt
./Documentation/docutils.conf
./drivers/gpu/drm/amd/display/modules/power/Makefile
./drivers/media/dvb-frontends/cxd2880/Kconfig
./drivers/net/ethernet/hisilicon/hns3/hns3vf/Makefile
./drivers/parport/Makefile
./drivers/staging/mt7621-dts/TODO
./drivers/staging/rts5208/TODO
./drivers/staging/vt6655/test
./sound/soc/mediatek/common/Makefile
./sound/soc/tegra/Makefile
./sound/usb/bcd2000/Makefile
./tools/firmware/Makefile
./tools/perf/pmu-events/arch/powerpc/power9/cache.json
./tools/perf/pmu-events/arch/powerpc/power9/floating-point.json
./tools/perf/pmu-events/arch/powerpc/power9/frontend.json
./tools/perf/pmu-events/arch/powerpc/power9/marked.json
./tools/perf/pmu-events/arch/powerpc/power9/memory.json
./tools/perf/pmu-events/arch/powerpc/power9/other.json
./tools/perf/pmu-events/arch/powerpc/power9/pipeline.json
./tools/perf/pmu-events/arch/powerpc/power9/pmc.json
./tools/perf/pmu-events/arch/powerpc/power9/translation.json
./tools/perf/pmu-events/arch/x86/bonnell/cache.json
./tools/perf/pmu-events/arch/x86/bonnell/floating-point.json
./tools/perf/pmu-events/arch/x86/bonnell/frontend.json
./tools/perf/pmu-events/arch/x86/bonnell/memory.json
./tools/perf/pmu-events/arch/x86/bonnell/other.json
./tools/perf/pmu-events/arch/x86/bonnell/pipeline.json
./tools/perf/pmu-events/arch/x86/bonnell/virtual-memory.json
./tools/perf/pmu-events/arch/x86/broadwell/cache.json
./tools/perf/pmu-events/arch/x86/broadwellde/cache.json
./tools/perf/pmu-events/arch/x86/broadwellde/floating-point.json
./tools/perf/pmu-events/arch/x86/broadwellde/frontend.json
./tools/perf/pmu-events/arch/x86/broadwellde/memory.json
./tools/perf/pmu-events/arch/x86/broadwellde/other.json
./tools/perf/pmu-events/arch/x86/broadwellde/pipeline.json
./tools/perf/pmu-events/arch/x86/broadwellde/virtual-memory.json
./tools/perf/pmu-events/arch/x86/broadwell/floating-point.json
./tools/perf/pmu-events/arch/x86/broadwell/frontend.json
./tools/perf/pmu-events/arch/x86/broadwell/memory.json
./tools/perf/pmu-events/arch/x86/broadwell/other.json
./tools/perf/pmu-events/arch/x86/broadwell/pipeline.json
./tools/perf/pmu-events/arch/x86/broadwell/uncore.json
./tools/perf/pmu-events/arch/x86/broadwell/virtual-memory.json
./tools/perf/pmu-events/arch/x86/broadwellx/cache.json
./tools/perf/pmu-events/arch/x86/broadwellx/floating-point.json
./tools/perf/pmu-events/arch/x86/broadwellx/frontend.json
./tools/perf/pmu-events/arch/x86/broadwellx/memory.json
./tools/perf/pmu-events/arch/x86/broadwellx/other.json
./tools/perf/pmu-events/arch/x86/broadwellx/pipeline.json
./tools/perf/pmu-events/arch/x86/broadwellx/virtual-memory.json
./tools/perf/pmu-events/arch/x86/cascadelakex/cache.json
./tools/perf/pmu-events/arch/x86/cascadelakex/floating-point.json
./tools/perf/pmu-events/arch/x86/cascadelakex/frontend.json
./tools/perf/pmu-events/arch/x86/cascadelakex/memory.json
./tools/perf/pmu-events/arch/x86/cascadelakex/other.json
./tools/perf/pmu-events/arch/x86/cascadelakex/pipeline.json
./tools/perf/pmu-events/arch/x86/cascadelakex/virtual-memory.json
./tools/perf/pmu-events/arch/x86/goldmont/cache.json
./tools/perf/pmu-events/arch/x86/goldmont/frontend.json
./tools/perf/pmu-events/arch/x86/goldmont/memory.json
./tools/perf/pmu-events/arch/x86/goldmont/other.json
./tools/perf/pmu-events/arch/x86/goldmont/pipeline.json
./tools/perf/pmu-events/arch/x86/goldmontplus/cache.json
./tools/perf/pmu-events/arch/x86/goldmontplus/frontend.json
./tools/perf/pmu-events/arch/x86/goldmontplus/memory.json
./tools/perf/pmu-events/arch/x86/goldmontplus/other.json
./tools/perf/pmu-events/arch/x86/goldmontplus/pipeline.json
./tools/perf/pmu-events/arch/x86/goldmontplus/virtual-memory.json
./tools/perf/pmu-events/arch/x86/goldmont/virtual-memory.json
./tools/perf/pmu-events/arch/x86/haswell/cache.json
./tools/perf/pmu-events/arch/x86/haswell/floating-point.json
./tools/perf/pmu-events/arch/x86/haswell/frontend.json
./tools/perf/pmu-events/arch/x86/haswell/memory.json
./tools/perf/pmu-events/arch/x86/haswell/other.json
./tools/perf/pmu-events/arch/x86/haswell/pipeline.json
./tools/perf/pmu-events/arch/x86/haswell/uncore.json
./tools/perf/pmu-events/arch/x86/haswell/virtual-memory.json
./tools/perf/pmu-events/arch/x86/haswellx/cache.json
./tools/perf/pmu-events/arch/x86/haswellx/floating-point.json
./tools/perf/pmu-events/arch/x86/haswellx/frontend.json
./tools/perf/pmu-events/arch/x86/haswellx/memory.json
./tools/perf/pmu-events/arch/x86/haswellx/other.json
./tools/perf/pmu-events/arch/x86/haswellx/pipeline.json
./tools/perf/pmu-events/arch/x86/haswellx/virtual-memory.json
./tools/perf/pmu-events/arch/x86/ivybridge/cache.json
./tools/perf/pmu-events/arch/x86/ivybridge/floating-point.json
./tools/perf/pmu-events/arch/x86/ivybridge/frontend.json
./tools/perf/pmu-events/arch/x86/ivybridge/memory.json
./tools/perf/pmu-events/arch/x86/ivybridge/other.json
./tools/perf/pmu-events/arch/x86/ivybridge/pipeline.json
./tools/perf/pmu-events/arch/x86/ivybridge/uncore.json
./tools/perf/pmu-events/arch/x86/ivybridge/virtual-memory.json
./tools/perf/pmu-events/arch/x86/ivytown/cache.json
./tools/perf/pmu-events/arch/x86/ivytown/floating-point.json
./tools/perf/pmu-events/arch/x86/ivytown/frontend.json
./tools/perf/pmu-events/arch/x86/ivytown/memory.json
./tools/perf/pmu-events/arch/x86/ivytown/other.json
./tools/perf/pmu-events/arch/x86/ivytown/pipeline.json
./tools/perf/pmu-events/arch/x86/ivytown/virtual-memory.json
./tools/perf/pmu-events/arch/x86/jaketown/cache.json
./tools/perf/pmu-events/arch/x86/jaketown/floating-point.json
./tools/perf/pmu-events/arch/x86/jaketown/frontend.json
./tools/perf/pmu-events/arch/x86/jaketown/memory.json
./tools/perf/pmu-events/arch/x86/jaketown/other.json
./tools/perf/pmu-events/arch/x86/jaketown/pipeline.json
./tools/perf/pmu-events/arch/x86/jaketown/virtual-memory.json
./tools/perf/pmu-events/arch/x86/knightslanding/cache.json
./tools/perf/pmu-events/arch/x86/knightslanding/frontend.json
./tools/perf/pmu-events/arch/x86/knightslanding/memory.json
./tools/perf/pmu-events/arch/x86/knightslanding/pipeline.json
./tools/perf/pmu-events/arch/x86/knightslanding/virtual-memory.json
./tools/perf/pmu-events/arch/x86/nehalemep/cache.json
./tools/perf/pmu-events/arch/x86/nehalemep/floating-point.json
./tools/perf/pmu-events/arch/x86/nehalemep/frontend.json
./tools/perf/pmu-events/arch/x86/nehalemep/memory.json
./tools/perf/pmu-events/arch/x86/nehalemep/other.json
./tools/perf/pmu-events/arch/x86/nehalemep/pipeline.json
./tools/perf/pmu-events/arch/x86/nehalemep/virtual-memory.json
./tools/perf/pmu-events/arch/x86/nehalemex/cache.json
./tools/perf/pmu-events/arch/x86/nehalemex/floating-point.json
./tools/perf/pmu-events/arch/x86/nehalemex/frontend.json
./tools/perf/pmu-events/arch/x86/nehalemex/memory.json
./tools/perf/pmu-events/arch/x86/nehalemex/other.json
./tools/perf/pmu-events/arch/x86/nehalemex/pipeline.json
./tools/perf/pmu-events/arch/x86/nehalemex/virtual-memory.json
./tools/perf/pmu-events/arch/x86/sandybridge/cache.json
./tools/perf/pmu-events/arch/x86/sandybridge/floating-point.json
./tools/perf/pmu-events/arch/x86/sandybridge/frontend.json
./tools/perf/pmu-events/arch/x86/sandybridge/memory.json
./tools/perf/pmu-events/arch/x86/sandybridge/other.json
./tools/perf/pmu-events/arch/x86/sandybridge/pipeline.json
./tools/perf/pmu-events/arch/x86/sandybridge/uncore.json
./tools/perf/pmu-events/arch/x86/sandybridge/virtual-memory.json
./tools/perf/pmu-events/arch/x86/silvermont/cache.json
./tools/perf/pmu-events/arch/x86/silvermont/frontend.json
./tools/perf/pmu-events/arch/x86/silvermont/memory.json
./tools/perf/pmu-events/arch/x86/silvermont/other.json
./tools/perf/pmu-events/arch/x86/silvermont/pipeline.json
./tools/perf/pmu-events/arch/x86/silvermont/virtual-memory.json
./tools/perf/pmu-events/arch/x86/skylake/cache.json
./tools/perf/pmu-events/arch/x86/skylake/floating-point.json
./tools/perf/pmu-events/arch/x86/skylake/frontend.json
./tools/perf/pmu-events/arch/x86/skylake/memory.json
./tools/perf/pmu-events/arch/x86/skylake/other.json
./tools/perf/pmu-events/arch/x86/skylake/pipeline.json
./tools/perf/pmu-events/arch/x86/skylake/uncore.json
./tools/perf/pmu-events/arch/x86/skylake/virtual-memory.json
./tools/perf/pmu-events/arch/x86/skylakex/cache.json
./tools/perf/pmu-events/arch/x86/skylakex/floating-point.json
./tools/perf/pmu-events/arch/x86/skylakex/frontend.json
./tools/perf/pmu-events/arch/x86/skylakex/memory.json
./tools/perf/pmu-events/arch/x86/skylakex/other.json
./tools/perf/pmu-events/arch/x86/skylakex/pipeline.json
./tools/perf/pmu-events/arch/x86/skylakex/virtual-memory.json
./tools/perf/pmu-events/arch/x86/westmereep-dp/cache.json
./tools/perf/pmu-events/arch/x86/westmereep-dp/floating-point.json
./tools/perf/pmu-events/arch/x86/westmereep-dp/frontend.json
./tools/perf/pmu-events/arch/x86/westmereep-dp/memory.json
./tools/perf/pmu-events/arch/x86/westmereep-dp/other.json
./tools/perf/pmu-events/arch/x86/westmereep-dp/pipeline.json
./tools/perf/pmu-events/arch/x86/westmereep-dp/virtual-memory.json
./tools/perf/pmu-events/arch/x86/westmereep-sp/cache.json
./tools/perf/pmu-events/arch/x86/westmereep-sp/floating-point.json
./tools/perf/pmu-events/arch/x86/westmereep-sp/frontend.json
./tools/perf/pmu-events/arch/x86/westmereep-sp/memory.json
./tools/perf/pmu-events/arch/x86/westmereep-sp/other.json
./tools/perf/pmu-events/arch/x86/westmereep-sp/pipeline.json
./tools/perf/pmu-events/arch/x86/westmereep-sp/virtual-memory.json
./tools/perf/pmu-events/arch/x86/westmereex/cache.json
./tools/perf/pmu-events/arch/x86/westmereex/floating-point.json
./tools/perf/pmu-events/arch/x86/westmereex/frontend.json
./tools/perf/pmu-events/arch/x86/westmereex/memory.json
./tools/perf/pmu-events/arch/x86/westmereex/other.json
./tools/perf/pmu-events/arch/x86/westmereex/pipeline.json
./tools/perf/pmu-events/arch/x86/westmereex/virtual-memory.json
./tools/perf/scripts/python/bin/intel-pt-events-report
./tools/power/cpupower/bench/cpufreq-bench_plot.sh
./tools/power/cpupower/bench/cpufreq-bench_script.sh
./tools/testing/selftests/exec/.gitignore
./tools/testing/selftests/powerpc/mm/.gitignore




>  Should _any_ file extension
> be excluded?
>
> I believe not, but perhaps it's best to ask.
>
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Proposal] end of file checks by checkpatch.pl
  2019-05-13 23:46       ` Masahiro Yamada
@ 2019-05-13 23:58         ` Joe Perches
  2019-05-14  0:54           ` Masahiro Yamada
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2019-05-13 23:58 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: Linux Kernel Mailing List, Andy Whitcroft

On Tue, 2019-05-14 at 08:46 +0900, Masahiro Yamada wrote:
> So, I think these two checks can be done for
> all file types.
[]
> checkpatch.pl misses to report most of them.
> (the majority of the warning source is *.json)

Perhaps the json files should be ignored as more than
half of the .json files in the tree are missing the
newline at EOF.

And at least some of those json files use spaces for
indentation and not tabs.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Proposal] end of file checks by checkpatch.pl
  2019-05-13 23:58         ` Joe Perches
@ 2019-05-14  0:54           ` Masahiro Yamada
  0 siblings, 0 replies; 7+ messages in thread
From: Masahiro Yamada @ 2019-05-14  0:54 UTC (permalink / raw)
  To: Joe Perches; +Cc: Linux Kernel Mailing List, Andy Whitcroft

On Tue, May 14, 2019 at 9:01 AM Joe Perches <joe@perches.com> wrote:
>
> On Tue, 2019-05-14 at 08:46 +0900, Masahiro Yamada wrote:
> > So, I think these two checks can be done for
> > all file types.
> []
> > checkpatch.pl misses to report most of them.
> > (the majority of the warning source is *.json)
>
> Perhaps the json files should be ignored as more than
> half of the .json files in the tree are missing the
> newline at EOF.


I guess they are accident.

I do not think missing newline in *.json
is syntactically significant.


If we are unsure, it is better to ask the maintainers.


> And at least some of those json files use spaces for
> indentation and not tabs.

This is different stuff.

Indentation and newline at EOF are not linked.


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-05-14  0:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-09 15:27 [Proposal] end of file checks by checkpatch.pl Masahiro Yamada
2019-05-09 17:19 ` Joe Perches
2019-05-13 10:11   ` Masahiro Yamada
2019-05-13 15:51     ` Joe Perches
2019-05-13 23:46       ` Masahiro Yamada
2019-05-13 23:58         ` Joe Perches
2019-05-14  0:54           ` Masahiro Yamada

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 NNTP newsgroup(s).