public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Prasad Pandit <pjp@fedoraproject.org>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: "linux-kbuild@vger.kernel.org" <linux-kbuild@vger.kernel.org>
Subject: Re: [PATCH v1] kconfig: add config and source entry details
Date: Tue, 23 Apr 2024 06:16:07 +0000 (UTC)	[thread overview]
Message-ID: <1927988181.1604457.1713852967808@mail.yahoo.com> (raw)
In-Reply-To: <CAK7LNAReoYHT0-SUzFT11y=pN6GTLSgu0+7Su+2Tthkz5VFymw@mail.gmail.com>

Hi,

On Saturday, 20 April, 2024 at 12:54:59 pm IST, Masahiro Yamada wrote: 
>>Because even config entries ending with an 'EOF' are not flagged as an error.
>Why should it be flagged as an error?

* Kconfig file defines records of config entries, wherein each line starts with a keyword. Line there implies an EOL at the end. So when a config entry does not end with an EOL, then it is inconsistent with other config records, which then requires special handling while parsing. Ex.

   config OPTION-A
      bool
      default 1

   config OPTION-B
      stirng
      default "Value-B"

   ....

   config OPTION-N
      int<EOF>

If the last entry was like int<EOL><EOF>, that makes them entries consistent and easier to parse. I don't see much value in allowing such inconsistency.


>Kconfig does not require a new line at the end of file.
>Same for other languages such as C, Python, etc.

* It's not about EOL at the end of file, but EOL at the end of a config entry/record.

* C, Python all languages define statements to have fixed format ex. in C statement must end with a semi-colon (;), a function definition has to have both opening ({) and closing braces (}). Python requires that a conditional statement must end with a colon (:) character, Python also requires that indentations are consistent.

    $ python t.py 
    File "/tmp/t.py", line 3
      if (x == 10)
                ^
    SyntaxError: expected ':'

And any such digressions are flagged as an error. IMHO, config entry records should have consistent format/syntax.


Thank you.
---
  -Prasad

  reply	other threads:[~2024-04-23  6:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-07  7:29 [PATCH v1] kconfig: add config and source entry details Prasad Pandit
2024-04-16  6:50 ` Prasad Pandit
2024-04-16 11:48 ` Masahiro Yamada
2024-04-17  6:29   ` Prasad Pandit
2024-04-20  7:24     ` Masahiro Yamada
2024-04-23  6:16       ` Prasad Pandit [this message]
2024-04-23 10:10         ` Masahiro Yamada
2024-04-24  5:25           ` Prasad Pandit
2024-04-26 19:21             ` Masahiro Yamada
2024-04-30  7:36               ` Prasad Pandit

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=1927988181.1604457.1713852967808@mail.yahoo.com \
    --to=pjp@fedoraproject.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=pj.pandit@yahoo.in \
    /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