rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guilherme Giacomo Simoes <trintaeoitogc@gmail.com>
To: joe@perches.com
Cc: a.hindborg@kernel.org, alex.gaynor@gmail.com,
	aliceryhl@google.com, apw@canonical.com, arnd@arndb.de,
	aswinunni01@gmail.com, axboe@kernel.dk, benno.lossin@proton.me,
	bhelgaas@google.com, bjorn3_gh@protonmail.com,
	boqun.feng@gmail.com, dakr@kernel.org, dwaipayanray1@gmail.com,
	ethan.twardy@gmail.com, fujita.tomonori@gmail.com,
	gary@garyguo.net, gregkh@linuxfoundation.org,
	linux-kernel@vger.kernel.org, lukas.bulwahn@gmail.com,
	ojeda@kernel.org, pbonzini@redhat.com,
	rust-for-linux@vger.kernel.org, tmgross@umich.edu,
	trintaeoitogc@gmail.com, walmeida@microsoft.com
Subject: Re: [PATCH 3/3] checkpatch: throw error in malformed arrays
Date: Thu, 13 Feb 2025 15:20:11 -0300	[thread overview]
Message-ID: <20250213182011.201234-1-trintaeoitogc@gmail.com> (raw)
In-Reply-To: <3a6b43bad48592887d4e67ca854eef2728464b1c.camel@perches.com>

Joe Perches <joe@perches.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

  reply	other threads:[~2025-02-13 18:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-12 19:48 [PATCH 2/3] rust: macros: change author field to array Guilherme Giacomo Simoes
2025-02-12 19:48 ` [PATCH 3/3] checkpatch: throw error in malformed arrays Guilherme Giacomo Simoes
2025-02-13 11:17   ` Joe Perches
2025-02-13 18:20     ` Guilherme Giacomo Simoes [this message]
2025-02-13 11:34 ` [PATCH 2/3] rust: macros: change author field to array Gary Guo
2025-02-13 17:46   ` Guilherme Giacomo Simoes

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=20250213182011.201234-1-trintaeoitogc@gmail.com \
    --to=trintaeoitogc@gmail.com \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=apw@canonical.com \
    --cc=arnd@arndb.de \
    --cc=aswinunni01@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=benno.lossin@proton.me \
    --cc=bhelgaas@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=dwaipayanray1@gmail.com \
    --cc=ethan.twardy@gmail.com \
    --cc=fujita.tomonori@gmail.com \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=ojeda@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    --cc=walmeida@microsoft.com \
    /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 NNTP newsgroup(s).