diff mbox series

[v2] devtools: clarify that lines up to 100 characters are ok

Message ID 20211020142601.157649-1-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show
Series [v2] devtools: clarify that lines up to 100 characters are ok | expand

Checks

Context Check Description
ci/iol-mellanox-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-spell-check-testing warning Testing issues
ci/checkpatch success coding style OK

Commit Message

Bruce Richardson Oct. 20, 2021, 2:26 p.m. UTC
Since we allow line lengths of up to 100, and the CI checkpatches job
only check for that amount, the rest of our tooling and docs should
reflect this reality. Therefore we can:

* adjust the editorconfig to use that value, to save editors (e.g. vim)
  from automatically wrapping lines at 80 characters when typing.
  [Since python checkers all seem to expect 79 character lines max, add
  for python only a 79-char max line length.]

* change the default line length setting in checkpatches script to 100
  so as it matches CI and pre-merge checks.

* update the docs to clarify that while 80 chars is recommended, up to
  100 characters is acceptable.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
V2: update the checkpatches default and the docs.

---
 .editorconfig                            | 3 ++-
 devtools/checkpatches.sh                 | 2 +-
 doc/guides/contributing/coding_style.rst | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

Comments

Andrew Rybchenko Oct. 20, 2021, 2:28 p.m. UTC | #1
On 10/20/21 5:26 PM, Bruce Richardson wrote:
> Since we allow line lengths of up to 100, and the CI checkpatches job
> only check for that amount, the rest of our tooling and docs should
> reflect this reality. Therefore we can:
> 
> * adjust the editorconfig to use that value, to save editors (e.g. vim)
>   from automatically wrapping lines at 80 characters when typing.
>   [Since python checkers all seem to expect 79 character lines max, add
>   for python only a 79-char max line length.]
> 
> * change the default line length setting in checkpatches script to 100
>   so as it matches CI and pre-merge checks.
> 
> * update the docs to clarify that while 80 chars is recommended, up to
>   100 characters is acceptable.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Jerin Jacob Oct. 22, 2021, 12:11 a.m. UTC | #2
On Wed, Oct 20, 2021 at 7:58 PM Andrew Rybchenko
<andrew.rybchenko@oktetlabs.ru> wrote:
>
> On 10/20/21 5:26 PM, Bruce Richardson wrote:
> > Since we allow line lengths of up to 100, and the CI checkpatches job
> > only check for that amount, the rest of our tooling and docs should
> > reflect this reality. Therefore we can:
> >
> > * adjust the editorconfig to use that value, to save editors (e.g. vim)
> >   from automatically wrapping lines at 80 characters when typing.
> >   [Since python checkers all seem to expect 79 character lines max, add
> >   for python only a 79-char max line length.]
> >
> > * change the default line length setting in checkpatches script to 100
> >   so as it matches CI and pre-merge checks.
> >
> > * update the docs to clarify that while 80 chars is recommended, up to
> >   100 characters is acceptable.
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
>
> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>

Acked-by: Jerin Jacob <jerinj@marvell.com>


>
Xia, Chenbo Oct. 22, 2021, 8:21 a.m. UTC | #3
> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Bruce Richardson
> Sent: Wednesday, October 20, 2021 10:26 PM
> To: dev@dpdk.org
> Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>; Richardson, Bruce
> <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH v2] devtools: clarify that lines up to 100
> characters are ok
> 
> Since we allow line lengths of up to 100, and the CI checkpatches job
> only check for that amount, the rest of our tooling and docs should
> reflect this reality. Therefore we can:
> 
> * adjust the editorconfig to use that value, to save editors (e.g. vim)
>   from automatically wrapping lines at 80 characters when typing.
>   [Since python checkers all seem to expect 79 character lines max, add
>   for python only a 79-char max line length.]
> 
> * change the default line length setting in checkpatches script to 100
>   so as it matches CI and pre-merge checks.
> 
> * update the docs to clarify that while 80 chars is recommended, up to
>   100 characters is acceptable.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> 2.32.0

Glad to see this :)

Acked-by: Chenbo Xia <chenbo.xia@intel.com>
Fengchengwen Oct. 26, 2021, 12:30 a.m. UTC | #4
On 2021/10/20 22:26, Bruce Richardson wrote:
> Since we allow line lengths of up to 100, and the CI checkpatches job
> only check for that amount, the rest of our tooling and docs should
> reflect this reality. Therefore we can:
> 
> * adjust the editorconfig to use that value, to save editors (e.g. vim)
>   from automatically wrapping lines at 80 characters when typing.
>   [Since python checkers all seem to expect 79 character lines max, add
>   for python only a 79-char max line length.]
> 
> * change the default line length setting in checkpatches script to 100
>   so as it matches CI and pre-merge checks.
> 
> * update the docs to clarify that while 80 chars is recommended, up to
>   100 characters is acceptable.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Walsh, Conor Oct. 28, 2021, 1:14 p.m. UTC | #5
> From: dev <dev-bounces@dpdk.org> On Behalf Of Bruce Richardson
> Sent: Wednesday 20 October 2021 15:26
> To: dev@dpdk.org
> Cc: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>; Richardson,
> Bruce <bruce.richardson@intel.com>
> Subject: [dpdk-dev] [PATCH v2] devtools: clarify that lines up to 100
> characters are ok
> 
> Since we allow line lengths of up to 100, and the CI checkpatches job
> only check for that amount, the rest of our tooling and docs should
> reflect this reality. Therefore we can:
> 
> * adjust the editorconfig to use that value, to save editors (e.g. vim)
>   from automatically wrapping lines at 80 characters when typing.
>   [Since python checkers all seem to expect 79 character lines max, add
>   for python only a 79-char max line length.]
> 
> * change the default line length setting in checkpatches script to 100
>   so as it matches CI and pre-merge checks.
> 
> * update the docs to clarify that while 80 chars is recommended, up to
>   100 characters is acceptable.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---

I think it would be great to have clarity around this, since it seems to already be allowed.
Acked-by: Conor Walsh <conor.walsh@intel.com>
Thomas Monjalon Nov. 25, 2021, 10:51 a.m. UTC | #6
22/10/2021 02:11, Jerin Jacob:
> On Wed, Oct 20, 2021 at 7:58 PM Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru> wrote:
> > On 10/20/21 5:26 PM, Bruce Richardson wrote:
> > > Since we allow line lengths of up to 100, and the CI checkpatches job
> > > only check for that amount, the rest of our tooling and docs should
> > > reflect this reality. Therefore we can:
> > >
> > > * adjust the editorconfig to use that value, to save editors (e.g. vim)
> > >   from automatically wrapping lines at 80 characters when typing.
> > >   [Since python checkers all seem to expect 79 character lines max, add
> > >   for python only a 79-char max line length.]
> > >
> > > * change the default line length setting in checkpatches script to 100
> > >   so as it matches CI and pre-merge checks.
> > >
> > > * update the docs to clarify that while 80 chars is recommended, up to
> > >   100 characters is acceptable.
> > >
> > > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> >
> > Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> 
> Acked-by: Jerin Jacob <jerinj@marvell.com>

Acked-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Conor Walsh <conor.walsh@intel.com>

As long as we keep a preference/recommandation for 80 chars, I'm fine.
In general I like short lines, but I dislike some "forced" wrapping.
So allowing for longer lines and trusting authors to do what fits best
is a good call.

Acked-by: Thomas Monjalon <thomas@monjalon.net>

Applied, thanks.
diff mbox series

Patch

diff --git a/.editorconfig b/.editorconfig
index 5101630c8c..ab41c95085 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -11,11 +11,12 @@  trim_trailing_whitespace = true
 charset = utf-8
 indent_style = tab
 tab_width = 8
-max_line_length = 80
+max_line_length = 100
 
 [*.py]
 indent_style = space
 indent_size = 4
+max_line_length = 79
 
 [meson.build]
 indent_style = space
diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index c314d83a29..205b8a52bf 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -15,7 +15,7 @@  VALIDATE_NEW_API=$(dirname $(readlink -f $0))/check-symbol-change.sh
 # Codespell can also be enabled by setting DPDK_CHECKPATCH_CODESPELL to a valid path
 # to a dictionary.txt file if dictionary.txt is not in the default location.
 codespell=${DPDK_CHECKPATCH_CODESPELL:-enable}
-length=${DPDK_CHECKPATCH_LINE_LENGTH:-80}
+length=${DPDK_CHECKPATCH_LINE_LENGTH:-100}
 
 # override default Linux options
 options="--no-tree"
diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
index b27b5fcfdb..1ce5d00e36 100644
--- a/doc/guides/contributing/coding_style.rst
+++ b/doc/guides/contributing/coding_style.rst
@@ -27,7 +27,7 @@  Line length is recommended to be not more than 80 characters, including comments
 .. note::
 
 	The above is recommendation, and not a hard limit.
-	However, it is expected that the recommendations should be followed in all but the rarest situations.
+	Generally, line lengths up to 100 characters are acceptable in the code.
 
 C Comment Style
 ---------------