Skip to contentSkip to conversation

editorconfig: bump line length to 100

PATCH In review Bruce Richardson 7 participants 11 messages Oct 20, 2021 – Nov 25, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 editorconfig: bump line length to 100

Since we allow line lengths of up to 100, adjust the editorconfig to use that value, to save editors (such as 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.

---
 .editorconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
.editorconfig +2 -1
index 5101630c8c..ab41c95085 100644
@@ -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
Signature · 1 line
2.30.2
#1 lore raw
Quoted 3 lines · Bruce Richardson

Since we allow line lengths of up to 100, adjust the editorconfig to use that value, to save editors (such as vim) from automatically wrapping lines at 80 characters when typing.

DPDK_CHECKPATCH_LINE_LENGTH default is 80 in
devtools/checkpatches.sh

Quoted 28 lines

Since python checkers all seem to expect 79 character lines max, add for python only a 79-char max line length.

---
 .editorconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
.editorconfig +2 -1
index 5101630c8c..ab41c95085 100644
@@ -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
#2 lore raw
Quoted 8 lines · Andrew Rybchenko
Quoted 3 lines · Bruce Richardson

Since we allow line lengths of up to 100, adjust the editorconfig to use that value, to save editors (such as vim) from automatically wrapping lines at 80 characters when typing.

DPDK_CHECKPATCH_LINE_LENGTH default is 80 in
devtools/checkpatches.sh

Yes, but all the CIs run with it set to 100.

#3 lore raw
In reply to Andrew Rybchenko
Quoted 8 lines · Andrew Rybchenko
Quoted 3 lines · Bruce Richardson

Since we allow line lengths of up to 100, adjust the editorconfig to use that value, to save editors (such as vim) from automatically wrapping lines at 80 characters when typing.

DPDK_CHECKPATCH_LINE_LENGTH default is 80 in
devtools/checkpatches.sh

I'll do a v2 with that changed in it too, just to keep things consistent. It better reflects the state of reality in the code base.

/Bruce

#4 lore raw

PATCH v2 1/1 devtools: clarify that lines up to 100 characters are ok

In reply to Bruce Richardson

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.

---
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(-)
.editorconfig +2 -1
index 5101630c8c..ab41c95085 100644
@@ -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
devtools/checkpatches.sh +1 -1
index c314d83a29..205b8a52bf 100755
@@ -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"
doc/guides/contributing/coding_style.rst +1 -1
index b27b5fcfdb..1ce5d00e36 100644
@@ -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
 ---------------
Signature · 1 line
2.32.0
Acked-by on v2 1/1
#5 lore raw

Re: [dpdk-dev] [PATCH v2] devtools: clarify that lines up to 100 characters are ok

Quoted 9 lines · Bruce Richardson

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.]

Quoted 7 lines

* 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.

Acked-by
#6 lore raw

Re: [dpdk-dev] [PATCH v2] devtools: clarify that lines up to 100 characters are ok

Quoted 14 lines · Andrew Rybchenko
Quoted 12 lines · Bruce Richardson

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.

Quoted 6 lines
Quoted 4 lines

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

Quoted 1 line
Acked-by Chenbo Xia Acked-by Chengwen Feng Acked-by Conor Walsh Acked-by Applied
#7 lore raw

Re: [dpdk-dev] [PATCH v2] devtools: clarify that lines up to 100 characters are ok

22/10/2021 02:11, Jerin Jacob:

Quoted 15 lines
Quoted 13 lines · Andrew Rybchenko
Quoted 12 lines · Bruce Richardson

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.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

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

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.

Applied, thanks.

Acked-by on v2 1/1
#8 lore raw

Re: [dpdk-dev] [PATCH v2] devtools: clarify that lines up to 100 characters are ok

In reply to Bruce Richardson
Quoted 21 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Bruce Richardson
Sent: Wednesday, October 20, 2021 10:26 PM
To: [email protected]
Cc: Andrew Rybchenko <[email protected]>; Richardson, Bruce <[email protected]>
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.

Quoted 6 lines

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

---
2.32.0

Glad to see this :)

Acked-by on v2 1/1
#9 lore raw

Re: [dpdk-dev] [PATCH v2] devtools: clarify that lines up to 100 characters are ok

In reply to Bruce Richardson
Quoted 9 lines · Bruce Richardson

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.]

Quoted 7 lines

* 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.

Acked-by on v2 1/1
#10 lore raw

Re: [dpdk-dev] [PATCH v2] devtools: clarify that lines up to 100 characters are ok

In reply to Bruce Richardson
Quoted 17 lines

From: dev <[email protected]> On Behalf Of Bruce Richardson
Sent: Wednesday 20 October 2021 15:26
To: [email protected]
Cc: Andrew Rybchenko <[email protected]>; Richardson, Bruce <[email protected]>
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.]

Quoted 8 lines

* 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.

---

I think it would be great to have clarity around this, since it seems to already be allowed.