[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250213182011.201234-1-trintaeoitogc@gmail.com>
Date: Thu, 13 Feb 2025 15:20:11 -0300
From: Guilherme Giacomo Simoes <trintaeoitogc@...il.com>
To: joe@...ches.com
Cc: a.hindborg@...nel.org,
alex.gaynor@...il.com,
aliceryhl@...gle.com,
apw@...onical.com,
arnd@...db.de,
aswinunni01@...il.com,
axboe@...nel.dk,
benno.lossin@...ton.me,
bhelgaas@...gle.com,
bjorn3_gh@...tonmail.com,
boqun.feng@...il.com,
dakr@...nel.org,
dwaipayanray1@...il.com,
ethan.twardy@...il.com,
fujita.tomonori@...il.com,
gary@...yguo.net,
gregkh@...uxfoundation.org,
linux-kernel@...r.kernel.org,
lukas.bulwahn@...il.com,
ojeda@...nel.org,
pbonzini@...hat.com,
rust-for-linux@...r.kernel.org,
tmgross@...ch.edu,
trintaeoitogc@...il.com,
walmeida@...rosoft.com
Subject: Re: [PATCH 3/3] checkpatch: throw error in malformed arrays
Joe Perches <joe@...ches.com> wrotes:
> Isn't this is a style desire not a parsing limitation?
Yes.
> Probably not useful to add hungarian style naming.
hungarian style naminng ? Do you think that is better `array_parse_module` ?
> \s*.* could be just .*
>
> > + $inline = 1;
> > +
> > + if ($line =~ /author/) {
> > + $parse_module_arr{'author'} = 1;
> > + }
> > +
> > + if ($line =~ /alias/) {
> > + $parse_module_arr{'alias'} = 1;
> > + }
> > +
> > + if ($line =~ /firmware/) {
> > + $parse_module_arr{'firmware'} = 1;
> > + }
>
> $parse_module_arr{$1} = 1;
hmm, ok thanks.
> > + if ($line =~ $more_than_one_vl) {
> > + ERROR("ERR_ARRAY_MODULE_MACRO",
> > + "the key $key have more than one values in same line\n$here\n". cat_vet($rawline));
>
> "Prefer one value per line\n"
>
> ERR_ error prefixes are not useful.
> These seem more like a WARN than an ERROR
> Bad indentation
> And please use a $herevet temporary
>
>
> > + }
> > + elsif ($inline && $line !~ /\]/ && $line =~ /\["/) {
> > + ERROR("ERR_ARRAY_MODULE_MACRO",
> > + qq~the key $key need a new line after declare the key\n$here\n~ . cat_vet($rawline) . qq~\nFor example:
>
> Use } elsif
>
> "Prefer declaring keys on separate lines"
>
> Are quote characters allowed in keys?
> If not, this seems unnecessarily complicated.
>
> $herevet
>
> I think the qq is unnecessary and the for example
> should refer to some style documentation and not
> be explicit in checkpatch.
Okay, I will submit a v2 with your hints
Thanks,
Guilherme
Powered by blists - more mailing lists