Skip to contentSkip to conversation

devtools: increase default line length to 100

RFC PATCH In review Bruce Richardson 6 participants 13 messages Jun 8, 2020 – Aug 7, 2020

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 devtools: increase default line length to 100

Rather than continuing to recommend an 80-char line limit, let's take a hint from the Linux kernel[1] and aim for an 100-char recommended limit instead.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bdc48fa11e46f867ea4d75fa59ee87a7f48be144

---
 devtools/checkpatches.sh                 | 2 +-
 doc/guides/contributing/coding_style.rst | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
devtools/checkpatches.sh +1 -1
index 158087f1c..4970ed830 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 4efde93f6..1db3a7bbe 100644
@@ -21,7 +21,7 @@ The rules and guidelines given in this document cannot cover every situation, so
 * In the case of creating new files, the style should be consistent within each file in a given directory or module.
 * The primary reason for coding standards is to increase code readability and comprehensibility, therefore always use whatever option will make the code easiest to read.
 
-Line length is recommended to be not more than 80 characters, including comments.
+Line length is recommended to be not more than 100 characters, including comments.
 [Tab stop size should be assumed to be 8-characters wide].
 
 .. note::
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 29 lines · On Mon, 8 Jun 2020 17:46:40 +0100 Bruce Richardson…

Rather than continuing to recommend an 80-char line limit, let's take a hint from the Linux kernel[1] and aim for an 100-char recommended limit instead.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bdc48fa11e46f867ea4d75fa59ee87a7f48be144

---
 devtools/checkpatches.sh                 | 2 +-
 doc/guides/contributing/coding_style.rst | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
devtools/checkpatches.sh +1 -1
index 158087f1c..4970ed830 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 +0 -0
index 4efde93f6..1db3a7bbe 100644

doc/guides/contributing/coding_style.rst The rules and guidelines given in this document cannot cover every situation, so · line 27

Quoted 8 lines
doc/guides/contributing/coding_style.rst +1 -1
@@ -21,7 +21,7 @@ The rules and guidelines given in this document cannot cover every situation, so
 * In the case of creating new files, the style should be consistent within each file in a given directory or module.
 * The primary reason for coding standards is to increase code readability and comprehensibility, therefore always use whatever option will make the code easiest to read.
 
-Line length is recommended to be not more than 80 characters, including comments.
+Line length is recommended to be not more than 100 characters, including comments.
 [Tab stop size should be assumed to be 8-characters wide].
 
 .. note::

I would even support going to 120 characters.

Acked-by
#2 lore raw
Quoted 40 lines · Stephen Hemminger
Quoted 36 lines · On Mon, 8 Jun 2020 17:46:40 +0100 Bruce Richardson…

Rather than continuing to recommend an 80-char line limit, let's take a hint from the Linux kernel[1] and aim for an 100-char recommended limit instead.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bdc48fa11e46f867ea4d75fa59ee87a7f48be144

---
 devtools/checkpatches.sh                 | 2 +-
 doc/guides/contributing/coding_style.rst | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
devtools/checkpatches.sh +1 -1
index 158087f1c..4970ed830 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 4efde93f6..1db3a7bbe 100644
@@ -21,7 +21,7 @@ The rules and guidelines given in this document cannot cover every situation, so
 * In the case of creating new files, the style should be consistent within each file in a given directory or module.
 * The primary reason for coding standards is to increase code readability and comprehensibility, therefore always use whatever option will make the code easiest to read.
 
-Line length is recommended to be not more than 80 characters, including comments.
+Line length is recommended to be not more than 100 characters, including comments.
 [Tab stop size should be assumed to be 8-characters wide].
 
Quoted 5 lines

doc/guides/contributing/coding_style.rst The rules and guidelines given in this document cannot cover every situation, so · line 27

Quoted 1 line
doc/guides/contributing/coding_style.rst +0 -0
 .. note::

I would even support going to 120 characters.

#3 lore raw
In reply to Stephen Hemminger
Quoted 39 lines · Stephen Hemminger
Quoted 36 lines · On Mon, 8 Jun 2020 17:46:40 +0100 Bruce Richardson…

Rather than continuing to recommend an 80-char line limit, let's take a hint from the Linux kernel[1] and aim for an 100-char recommended limit instead.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bdc48fa11e46f867ea4d75fa59ee87a7f48be144

---
 devtools/checkpatches.sh                 | 2 +-
 doc/guides/contributing/coding_style.rst | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
devtools/checkpatches.sh +1 -1
index 158087f1c..4970ed830 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 4efde93f6..1db3a7bbe 100644
@@ -21,7 +21,7 @@ The rules and guidelines given in this document cannot cover every situation, so
 * In the case of creating new files, the style should be consistent within each file in a given directory or module.
 * The primary reason for coding standards is to increase code readability and comprehensibility, therefore always use whatever option will make the code easiest to read.
 
-Line length is recommended to be not more than 80 characters, including comments.
+Line length is recommended to be not more than 100 characters, including comments.
 [Tab stop size should be assumed to be 8-characters wide].
 
Quoted 5 lines

doc/guides/contributing/coding_style.rst The rules and guidelines given in this document cannot cover every situation, so · line 27

Quoted 1 line
doc/guides/contributing/coding_style.rst +0 -0
 .. note::

I would even support going to 120 characters.

I think 100 is enough.

In my case, I have a 1080p 24" monitor, and with two terminals side-by-side 100 characters just fits inside each vim window. Going to 120 would be fine for single terminal at a time, but I would find awkward for e.g. side-by-side diff comparison in meld etc.

#4 lore raw
Quoted 47 lines · Stephen Hemminger
Quoted 25 lines
Quoted 22 lines · On Mon, 8 Jun 2020 17:46:40 +0100 Bruce Richardson…

Rather than continuing to recommend an 80-char line limit, let's take a hint from the Linux kernel[1] and aim for an 100-char recommended limit instead.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bdc48fa11e46f867ea4d75fa59ee87a7f48be144

---
 devtools/checkpatches.sh                 | 2 +-
 doc/guides/contributing/coding_style.rst | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
devtools/checkpatches.sh +1 -1
index 158087f1c..4970ed830 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}
 
Quoted 9 lines

doc/guides/contributing/coding_style.rst The rules and guidelines given in this document cannot cover every situation, so · line 22

Quoted 9 lines
devtools/checkpatches.sh +0 -0
 # override default Linux options
 options="--no-tree"
doc/guides/contributing/coding_style.rst +0 -0
index 4efde93f6..1db3a7bbe 100644
@@ -21,7 +21,7 @@ The rules and guidelines given in this document cannot cover every situation, so
 * In the case of creating new files, the style should be consistent within each file in a given directory or module.
 * The primary reason for coding standards is to increase code readability and comprehensibility, therefore always use whatever option

will make the code easiest to read.

Quoted 9 lines

doc/guides/contributing/coding_style.rst The rules and guidelines given in this document cannot cover every situation, so · line 27

Quoted 6 lines
doc/guides/contributing/coding_style.rst +1 -1
-Line length is recommended to be not more than 80 characters, including comments.
+Line length is recommended to be not more than 100 characters, including comments.
 [Tab stop size should be assumed to be 8-characters wide].
 
 .. note::

I would even support going to 120 characters.

Quoted 8 lines
Quoted 1 line

I think 100 is enough.

In my case, I have a 1080p 24" monitor, and with two terminals side-by-side 100 characters just fits inside each vim window. Going to 120 would be fine for single terminal at a time, but I would find awkward for e.g. side-by-side diff comparison in meld etc.

My preference would be to keep things as it is - 80 chars per line. Having multiple different formatting styles in one source file looks really awkward and make it hard to follow.

#5 lore raw
Quoted 51 lines · Konstantin
Quoted 51 lines · Stephen Hemminger
Quoted 25 lines
Quoted 22 lines · On Mon, 8 Jun 2020 17:46:40 +0100 Bruce Richardson…

Rather than continuing to recommend an 80-char line limit, let's take a hint from the Linux kernel[1] and aim for an 100-char recommended limit instead.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bdc48fa11e46f867ea4d75fa59ee87a7f48be144

---
 devtools/checkpatches.sh                 | 2 +-
 doc/guides/contributing/coding_style.rst | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
devtools/checkpatches.sh +1 -1
index 158087f1c..4970ed830 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}
 
Quoted 9 lines

doc/guides/contributing/coding_style.rst The rules and guidelines given in this document cannot cover every situation, so · line 22

Quoted 9 lines
devtools/checkpatches.sh +0 -0
 # override default Linux options
 options="--no-tree"
doc/guides/contributing/coding_style.rst +0 -0
index 4efde93f6..1db3a7bbe 100644
@@ -21,7 +21,7 @@ The rules and guidelines given in this document cannot cover every situation, so
 * In the case of creating new files, the style should be consistent within each file in a given directory or module.
 * The primary reason for coding standards is to increase code readability and comprehensibility, therefore always use whatever option

will make the code easiest to read.

Quoted 10 lines

doc/guides/contributing/coding_style.rst The rules and guidelines given in this document cannot cover every situation, so · line 27

Quoted 6 lines
doc/guides/contributing/coding_style.rst +1 -1
-Line length is recommended to be not more than 80 characters, including comments.
+Line length is recommended to be not more than 100 characters, including comments.
 [Tab stop size should be assumed to be 8-characters wide].
 
 .. note::

I would even support going to 120 characters.

I think 100 is enough.

Quoted 8 lines
Quoted 4 lines

In my case, I have a 1080p 24" monitor, and with two terminals side-by-side 100 characters just fits inside each vim window. Going to 120 would be fine for single terminal at a time, but I would find awkward for e.g. side-by-side diff comparison in meld etc.

My preference would be to keep things as it is - 80 chars per line. Having multiple different formatting styles in one source file looks really awkward and make it hard to follow.

+1

#6 lore raw
Quoted 62 lines · Andrew Rybchenko
Quoted 61 lines · Konstantin
Quoted 60 lines · Stephen Hemminger
Quoted 26 lines
Quoted 23 lines · On Mon, 8 Jun 2020 17:46:40 +0100 Bruce Richardson…

Rather than continuing to recommend an 80-char line limit, let's take a hint from the Linux kernel[1] and aim for an 100-char recommended limit instead.

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bdc48fa11e46f867ea4d75fa59ee87a7f48be144

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

devtools/checkpatches.sh +0 -0
index 158087f1c..4970ed830 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}

devtools/checkpatches.sh +1 -1
-length=${DPDK_CHECKPATCH_LINE_LENGTH:-80}
+length=${DPDK_CHECKPATCH_LINE_LENGTH:-100}
Quoted 12 lines
Quoted 4 lines
 # override default Linux options options="--no-tree" diff --git
 a/doc/guides/contributing/coding_style.rst
 b/doc/guides/contributing/coding_style.rst index
 4efde93f6..1db3a7bbe 100644 ---
Quoted 8 lines
 a/doc/guides/contributing/coding_style.rst +++
 b/doc/guides/contributing/coding_style.rst @@ -21,7 +21,7 @@ The
 rules and guidelines given in this document cannot cover every
 situation, so * In the case of creating new files, the style should
 be consistent within each file in a given directory or module.  *
 The primary reason for coding standards is to increase code
 readability and comprehensibility, therefore always use whatever
 option

will make the code easiest to read.

Quoted 11 lines
Quoted 7 lines

-Line length is recommended to be not more than 80 characters, including comments. +Line length is recommended to be not more than 100 characters, including comments. [Tab stop size should be assumed to be 8-characters wide].

.. note::

I would even support going to 120 characters.

I think 100 is enough.

In my case, I have a 1080p 24" monitor, and with two terminals side-by-side 100 characters just fits inside each vim window. Going to 120 would be fine for single terminal at a time, but I would find awkward for e.g. side-by-side diff comparison in meld etc.

Quoted 6 lines
Quoted 3 lines

My preference would be to keep things as it is - 80 chars per line. Having multiple different formatting styles in one source file looks really awkward and make it hard to follow.

+1

I wouldn't personally consider increasing the max line length as a style change, but even if you consider it such I'd worry about rejecting style changes on the basis that it may be different to what is there before. That logic means that we can never, ever change any element of DPDK coding style.

I can see the issue with changes that require us to rework the style of code in order to comply with the new style, but changing the max length from 80 to 100 does not make 80-char lines incorrect and needing changes.

Regards,
/Bruce

#7 lore raw
Quoted 70 lines · Bruce Richardson
Quoted 62 lines · Andrew Rybchenko
Quoted 61 lines · Konstantin
Quoted 60 lines · Stephen Hemminger
Quoted 26 lines
Quoted 23 lines · On Mon, 8 Jun 2020 17:46:40 +0100 Bruce Richardson…

Rather than continuing to recommend an 80-char line limit, let's take a hint from the Linux kernel[1] and aim for an 100-char recommended limit instead.

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bdc48fa11e46f867ea4d75fa59ee87a7f48be144

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

devtools/checkpatches.sh +0 -0
index 158087f1c..4970ed830 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}

devtools/checkpatches.sh +1 -1
-length=${DPDK_CHECKPATCH_LINE_LENGTH:-80}
+length=${DPDK_CHECKPATCH_LINE_LENGTH:-100}
Quoted 12 lines
Quoted 4 lines
 # override default Linux options options="--no-tree" diff --git
 a/doc/guides/contributing/coding_style.rst
 b/doc/guides/contributing/coding_style.rst index
 4efde93f6..1db3a7bbe 100644 ---
Quoted 8 lines
 a/doc/guides/contributing/coding_style.rst +++
 b/doc/guides/contributing/coding_style.rst @@ -21,7 +21,7 @@ The
 rules and guidelines given in this document cannot cover every
 situation, so * In the case of creating new files, the style should
 be consistent within each file in a given directory or module.  *
 The primary reason for coding standards is to increase code
 readability and comprehensibility, therefore always use whatever
 option

will make the code easiest to read.

Quoted 11 lines
Quoted 7 lines

-Line length is recommended to be not more than 80 characters, including comments. +Line length is recommended to be not more than 100 characters, including comments. [Tab stop size should be assumed to be 8-characters wide].

.. note::

I would even support going to 120 characters.

I think 100 is enough.

In my case, I have a 1080p 24" monitor, and with two terminals side-by-side 100 characters just fits inside each vim window. Going to 120 would be fine for single terminal at a time, but I would find awkward for e.g. side-by-side diff comparison in meld etc.

Quoted 6 lines
Quoted 3 lines

My preference would be to keep things as it is - 80 chars per line. Having multiple different formatting styles in one source file looks really awkward and make it hard to follow.

+1

Quoted 8 lines

I wouldn't personally consider increasing the max line length as a style change, but even if you consider it such I'd worry about rejecting style changes on the basis that it may be different to what is there before. That logic means that we can never, ever change any element of DPDK coding style.

I can see the issue with changes that require us to rework the style of code in order to comply with the new style, but changing the max length from 80 to 100 does not make 80-char lines incorrect and needing changes.

Another point is: Other projects derived from the Linux kernel coding standard also
getting migrated to the new coding standard. This change would be useful for:
a) People works on multiple Linux coding standard derived projects
b) Some of the code such as 'base' and 'common' code for HW drivers are shared between multiple projects.
Such code needs adjustment/change when pulling to the DPDK code base it it still follows 80 chars per line.

Quoted 3 lines

Regards,
/Bruce

#8 lore raw
Quoted 77 lines · Jerin Jacob
Quoted 75 lines · Bruce Richardson
Quoted 62 lines · Andrew Rybchenko
Quoted 61 lines · Konstantin
Quoted 60 lines · Stephen Hemminger
Quoted 26 lines
Quoted 23 lines · On Mon, 8 Jun 2020 17:46:40 +0100 Bruce Richardson…

Rather than continuing to recommend an 80-char line limit, let's take a hint from the Linux kernel[1] and aim for an 100-char recommended limit instead.

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bdc48fa11e46f867ea4d75fa59ee87a7f48be144

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

devtools/checkpatches.sh +0 -0
index 158087f1c..4970ed830 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}

devtools/checkpatches.sh +1 -1
-length=${DPDK_CHECKPATCH_LINE_LENGTH:-80}
+length=${DPDK_CHECKPATCH_LINE_LENGTH:-100}
Quoted 12 lines
Quoted 4 lines
 # override default Linux options options="--no-tree" diff --git
 a/doc/guides/contributing/coding_style.rst
 b/doc/guides/contributing/coding_style.rst index
 4efde93f6..1db3a7bbe 100644 ---
Quoted 8 lines
 a/doc/guides/contributing/coding_style.rst +++
 b/doc/guides/contributing/coding_style.rst @@ -21,7 +21,7 @@ The
 rules and guidelines given in this document cannot cover every
 situation, so * In the case of creating new files, the style should
 be consistent within each file in a given directory or module.  *
 The primary reason for coding standards is to increase code
 readability and comprehensibility, therefore always use whatever
 option

will make the code easiest to read.

Quoted 11 lines
Quoted 7 lines

-Line length is recommended to be not more than 80 characters, including comments. +Line length is recommended to be not more than 100 characters, including comments. [Tab stop size should be assumed to be 8-characters wide].

.. note::

I would even support going to 120 characters.

I think 100 is enough.

In my case, I have a 1080p 24" monitor, and with two terminals side-by-side 100 characters just fits inside each vim window. Going to 120 would be fine for single terminal at a time, but I would find awkward for e.g. side-by-side diff comparison in meld etc.

Quoted 6 lines
Quoted 3 lines

My preference would be to keep things as it is - 80 chars per line. Having multiple different formatting styles in one source file looks really awkward and make it hard to follow.

+1

I wouldn't personally consider increasing the max line length as a style change, but even if you consider it such I'd worry about rejecting style changes on the basis that it may be different to what is there before. That logic means that we can never, ever change any element of DPDK coding style.

Quoted 8 lines
Quoted 3 lines

I can see the issue with changes that require us to rework the style of code in order to comply with the new style, but changing the max length from 80 to 100 does not make 80-char lines incorrect and needing changes.

Another point is: Other projects derived from the Linux kernel coding standard also
getting migrated to the new coding standard. This change would be useful for:
a) People works on multiple Linux coding standard derived projects

Valid point, but not really strong.
I think that .editorconfig solves it.

Quoted 4 lines

b) Some of the code such as 'base' and 'common' code for HW drivers are shared between multiple projects.
Such code needs adjustment/change when pulling to the DPDK code base it it still follows 80 chars per line.

Base and common code are not required to follow DPDK coding style even now.

#9 lore raw
Quoted 83 lines · Andrew Rybchenko
Quoted 81 lines · Jerin Jacob
Quoted 78 lines · Bruce Richardson
Quoted 62 lines · Andrew Rybchenko
Quoted 61 lines · Konstantin
Quoted 60 lines · Stephen Hemminger
Quoted 26 lines
Quoted 23 lines · On Mon, 8 Jun 2020 17:46:40 +0100 Bruce Richardson…

Rather than continuing to recommend an 80-char line limit, let's take a hint from the Linux kernel[1] and aim for an 100-char recommended limit instead.

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bdc48fa11e46f867ea4d75fa59ee87a7f48be144

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

devtools/checkpatches.sh +0 -0
index 158087f1c..4970ed830 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}

devtools/checkpatches.sh +1 -1
-length=${DPDK_CHECKPATCH_LINE_LENGTH:-80}
+length=${DPDK_CHECKPATCH_LINE_LENGTH:-100}
Quoted 12 lines
Quoted 4 lines
 # override default Linux options options="--no-tree" diff --git
 a/doc/guides/contributing/coding_style.rst
 b/doc/guides/contributing/coding_style.rst index
 4efde93f6..1db3a7bbe 100644 ---
Quoted 8 lines
 a/doc/guides/contributing/coding_style.rst +++
 b/doc/guides/contributing/coding_style.rst @@ -21,7 +21,7 @@ The
 rules and guidelines given in this document cannot cover every
 situation, so * In the case of creating new files, the style should
 be consistent within each file in a given directory or module.  *
 The primary reason for coding standards is to increase code
 readability and comprehensibility, therefore always use whatever
 option

will make the code easiest to read.

Quoted 11 lines
Quoted 7 lines

-Line length is recommended to be not more than 80 characters, including comments. +Line length is recommended to be not more than 100 characters, including comments. [Tab stop size should be assumed to be 8-characters wide].

.. note::

I would even support going to 120 characters.

I think 100 is enough.

In my case, I have a 1080p 24" monitor, and with two terminals side-by-side 100 characters just fits inside each vim window. Going to 120 would be fine for single terminal at a time, but I would find awkward for e.g. side-by-side diff comparison in meld etc.

Quoted 6 lines
Quoted 3 lines

My preference would be to keep things as it is - 80 chars per line. Having multiple different formatting styles in one source file looks really awkward and make it hard to follow.

+1

I wouldn't personally consider increasing the max line length as a style change, but even if you consider it such I'd worry about rejecting style changes on the basis that it may be different to what is there before. That logic means that we can never, ever change any element of DPDK coding style.

I can see the issue with changes that require us to rework the style of code in order to comply with the new style, but changing the max length from 80 to 100 does not make 80-char lines incorrect and needing changes.

Quoted 7 lines
Quoted 4 lines

Another point is: Other projects derived from the Linux kernel coding standard also
getting migrated to the new coding standard. This change would be useful for:
a) People works on multiple Linux coding standard derived projects

Valid point, but not really strong.
I think that .editorconfig solves it.

Yes, For adding the code. I meaning, Viewing the code there will be a disparity.

Quoted 8 lines
Quoted 5 lines

b) Some of the code such as 'base' and 'common' code for HW drivers are shared between multiple projects.
Such code needs adjustment/change when pulling to the DPDK code base it it still follows 80 chars per line.

Base and common code are not required to follow DPDK coding style even now.

I see, I dont think it is expressed in devtools/checkpatches.sh. I.e CI tools still flag as checkpatch issues.

Coming to original concern:(code disparity with existing code) Another option is, It is possible to change existing code to 100 lines with clang-format in an automatic fashion. But it will have a lot of changes.
"C_Cpp.clang_format_style": "{ BasedOnStyle: LLVM,
IndentWidth: 8, TabWidth: 8, UseTab: Always, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false,
ColumnLimit: 100, AllowShortFunctionsOnASingleLine: false, AlwaysBreakAfterReturnType: AllDefinitions, ColumnLimit: 100, ConstructorInitializerAllOnOneLineOrOnePerLine: true, ConstructorInitializerIndentWidth: 8, ContinuationIndentWidth: 8,
BreakBeforeBraces: Linux, AllowShortBlocksOnASingleLine: false, AlignConsecutiveAssignments: false, AlignEscapedNewlines: Right, AlignConsecutiveMacros : true, MaxEmptyLinesToKeep : 1, Cpp11BracedListStyle : true, AlignTrailingComments : true,
ForEachMacros: ['TAILQ_FOREACH_SAFE', STAILQ_FOREACH', 'rte_graph_foreach_node', 'TAILQ_FOREACH', 'RTE_ETH_FOREACH_DEV']}",

#10 lore raw
Quoted 90 lines · Jerin Jacob
Quoted 88 lines · Andrew Rybchenko
Quoted 85 lines · Jerin Jacob
Quoted 70 lines · Bruce Richardson
Quoted 62 lines · Andrew Rybchenko
Quoted 61 lines · Konstantin
Quoted 60 lines · Stephen Hemminger
Quoted 26 lines
Quoted 23 lines · On Mon, 8 Jun 2020 17:46:40 +0100 Bruce Richardson…

Rather than continuing to recommend an 80-char line limit, let's take a hint from the Linux kernel[1] and aim for an 100-char recommended limit instead.

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bdc48fa11e46f867ea4d75fa59ee87a7f48be144

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

devtools/checkpatches.sh +0 -0
index 158087f1c..4970ed830 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}

devtools/checkpatches.sh +1 -1
-length=${DPDK_CHECKPATCH_LINE_LENGTH:-80}
+length=${DPDK_CHECKPATCH_LINE_LENGTH:-100}
Quoted 12 lines
Quoted 4 lines
 # override default Linux options options="--no-tree" diff --git
 a/doc/guides/contributing/coding_style.rst
 b/doc/guides/contributing/coding_style.rst index
 4efde93f6..1db3a7bbe 100644 ---
Quoted 8 lines
 a/doc/guides/contributing/coding_style.rst +++
 b/doc/guides/contributing/coding_style.rst @@ -21,7 +21,7 @@ The
 rules and guidelines given in this document cannot cover every
 situation, so * In the case of creating new files, the style should
 be consistent within each file in a given directory or module.  *
 The primary reason for coding standards is to increase code
 readability and comprehensibility, therefore always use whatever
 option

will make the code easiest to read.

Quoted 11 lines
Quoted 7 lines

-Line length is recommended to be not more than 80 characters, including comments. +Line length is recommended to be not more than 100 characters, including comments. [Tab stop size should be assumed to be 8-characters wide].

.. note::

I would even support going to 120 characters.

I think 100 is enough.

In my case, I have a 1080p 24" monitor, and with two terminals side-by-side 100 characters just fits inside each vim window. Going to 120 would be fine for single terminal at a time, but I would find awkward for e.g. side-by-side diff comparison in meld etc.

Quoted 6 lines
Quoted 3 lines

My preference would be to keep things as it is - 80 chars per line. Having multiple different formatting styles in one source file looks really awkward and make it hard to follow.

+1

Quoted 8 lines

I wouldn't personally consider increasing the max line length as a style change, but even if you consider it such I'd worry about rejecting style changes on the basis that it may be different to what is there before. That logic means that we can never, ever change any element of DPDK coding style.

I can see the issue with changes that require us to rework the style of code in order to comply with the new style, but changing the max length from 80 to 100 does not make 80-char lines incorrect and needing changes.

Another point is: Other projects derived from the Linux kernel coding standard also
getting migrated to the new coding standard. This change would be useful for:
a) People works on multiple Linux coding standard derived projects

Quoted 4 lines
Quoted 2 lines

Valid point, but not really strong.
I think that .editorconfig solves it.

Yes, For adding the code. I meaning, Viewing the code there will be a disparity.

I hope you're not suggesting to reformat all existing code. Otherwise the disparity will be there for a long-long time anyway.

Quoted 11 lines
Quoted 8 lines
Quoted 5 lines

b) Some of the code such as 'base' and 'common' code for HW drivers are shared between multiple projects.
Such code needs adjustment/change when pulling to the DPDK code base it it still follows 80 chars per line.

Base and common code are not required to follow DPDK coding style even now.

I see, I dont think it is expressed in devtools/checkpatches.sh. I.e CI tools still flag as checkpatch issues.

Yes, it is an area which should be improved.

Quoted 9 lines

Coming to original concern:(code disparity with existing code) Another option is, It is possible to change existing code to 100 lines with clang-format in an automatic fashion. But it will have a lot of changes.
"C_Cpp.clang_format_style": "{ BasedOnStyle: LLVM,
IndentWidth: 8, TabWidth: 8, UseTab: Always, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false,
ColumnLimit: 100, AllowShortFunctionsOnASingleLine: false, AlwaysBreakAfterReturnType: AllDefinitions, ColumnLimit: 100,

Quoted 8 lines

ConstructorInitializerAllOnOneLineOrOnePerLine: true, ConstructorInitializerIndentWidth: 8, ContinuationIndentWidth: 8,
BreakBeforeBraces: Linux, AllowShortBlocksOnASingleLine: false, AlignConsecutiveAssignments: false, AlignEscapedNewlines: Right, AlignConsecutiveMacros : true, MaxEmptyLinesToKeep : 1, Cpp11BracedListStyle : true, AlignTrailingComments : true,
ForEachMacros: ['TAILQ_FOREACH_SAFE', STAILQ_FOREACH', 'rte_graph_foreach_node', 'TAILQ_FOREACH', 'RTE_ETH_FOREACH_DEV']}",

No, no, no. Please, no. It will complicate backporting a lot, it will break (over-complicate) git blame.
(I hope it was suggested just to be sure that it will not be done).

#11 lore raw
Quoted 132 lines · Andrew Rybchenko
Quoted 90 lines · Jerin Jacob
Quoted 88 lines · Andrew Rybchenko
Quoted 85 lines · Jerin Jacob
Quoted 70 lines · Bruce Richardson
Quoted 62 lines · Andrew Rybchenko
Quoted 61 lines · Konstantin
Quoted 60 lines · Stephen Hemminger
Quoted 26 lines
Quoted 23 lines · On Mon, 8 Jun 2020 17:46:40 +0100 Bruce Richardson…

Rather than continuing to recommend an 80-char line limit, let's take a hint from the Linux kernel[1] and aim for an 100-char recommended limit instead.

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bdc48fa11e46f867ea4d75fa59ee87a7f48be144

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

devtools/checkpatches.sh +0 -0
index 158087f1c..4970ed830 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}

devtools/checkpatches.sh +1 -1
-length=${DPDK_CHECKPATCH_LINE_LENGTH:-80}
+length=${DPDK_CHECKPATCH_LINE_LENGTH:-100}
Quoted 12 lines
Quoted 4 lines
 # override default Linux options options="--no-tree" diff --git
 a/doc/guides/contributing/coding_style.rst
 b/doc/guides/contributing/coding_style.rst index
 4efde93f6..1db3a7bbe 100644 ---
Quoted 8 lines
 a/doc/guides/contributing/coding_style.rst +++
 b/doc/guides/contributing/coding_style.rst @@ -21,7 +21,7 @@ The
 rules and guidelines given in this document cannot cover every
 situation, so * In the case of creating new files, the style should
 be consistent within each file in a given directory or module.  *
 The primary reason for coding standards is to increase code
 readability and comprehensibility, therefore always use whatever
 option

will make the code easiest to read.

Quoted 11 lines
Quoted 7 lines

-Line length is recommended to be not more than 80 characters, including comments. +Line length is recommended to be not more than 100 characters, including comments. [Tab stop size should be assumed to be 8-characters wide].

.. note::

I would even support going to 120 characters.

I think 100 is enough.

In my case, I have a 1080p 24" monitor, and with two terminals side-by-side 100 characters just fits inside each vim window. Going to 120 would be fine for single terminal at a time, but I would find awkward for e.g. side-by-side diff comparison in meld etc.

Quoted 6 lines
Quoted 3 lines

My preference would be to keep things as it is - 80 chars per line. Having multiple different formatting styles in one source file looks really awkward and make it hard to follow.

+1

Quoted 8 lines

I wouldn't personally consider increasing the max line length as a style change, but even if you consider it such I'd worry about rejecting style changes on the basis that it may be different to what is there before. That logic means that we can never, ever change any element of DPDK coding style.

I can see the issue with changes that require us to rework the style of code in order to comply with the new style, but changing the max length from 80 to 100 does not make 80-char lines incorrect and needing changes.

Another point is: Other projects derived from the Linux kernel coding standard also
getting migrated to the new coding standard. This change would be useful for:
a) People works on multiple Linux coding standard derived projects

Quoted 4 lines
Quoted 2 lines

Valid point, but not really strong.
I think that .editorconfig solves it.

Yes, For adding the code. I meaning, Viewing the code there will be a disparity.

I hope you're not suggesting to reformat all existing code. Otherwise the disparity will be there for a long-long time anyway.

Quoted 11 lines
Quoted 8 lines
Quoted 5 lines

b) Some of the code such as 'base' and 'common' code for HW drivers are shared between multiple projects.
Such code needs adjustment/change when pulling to the DPDK code base it it still follows 80 chars per line.

Base and common code are not required to follow DPDK coding style even now.

I see, I dont think it is expressed in devtools/checkpatches.sh. I.e CI tools still flag as checkpatch issues.

Yes, it is an area which should be improved.

Quoted 9 lines

Coming to original concern:(code disparity with existing code) Another option is, It is possible to change existing code to 100 lines with clang-format in an automatic fashion. But it will have a lot of changes.
"C_Cpp.clang_format_style": "{ BasedOnStyle: LLVM,
IndentWidth: 8, TabWidth: 8, UseTab: Always, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false,
ColumnLimit: 100, AllowShortFunctionsOnASingleLine: false, AlwaysBreakAfterReturnType: AllDefinitions, ColumnLimit: 100,

Quoted 8 lines

ConstructorInitializerAllOnOneLineOrOnePerLine: true, ConstructorInitializerIndentWidth: 8, ContinuationIndentWidth: 8,
BreakBeforeBraces: Linux, AllowShortBlocksOnASingleLine: false, AlignConsecutiveAssignments: false, AlignEscapedNewlines: Right, AlignConsecutiveMacros : true, MaxEmptyLinesToKeep : 1, Cpp11BracedListStyle : true, AlignTrailingComments : true,
ForEachMacros: ['TAILQ_FOREACH_SAFE', STAILQ_FOREACH', 'rte_graph_foreach_node', 'TAILQ_FOREACH', 'RTE_ETH_FOREACH_DEV']}",

Quoted 4 lines

No, no, no. Please, no. It will complicate backporting a lot, it will break (over-complicate) git blame.
(I hope it was suggested just to be sure that it will not be done).

+1 for this. I don't think we can ever take any style changes into DPDK which require us to reformat all our existing code.

Thankfully, as I've stated before, this is not such a change, since code which is under 80 chars long is also under 100 chars long so no issue. :-)

#12 lore raw
In reply to Bruce Richardson

08/06/2020 18:46, Bruce Richardson:

devtools/checkpatches.sh VALIDATE_NEW_API=$(dirname $(readlink -f $0))/check-symbol-change.sh · line 18

Quoted 9 lines

Rather than continuing to recommend an 80-char line limit, let's take a hint from the Linux kernel[1] and aim for an 100-char recommended limit instead.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bdc48fa11e46f867ea4d75fa59ee87a7f48be144

---

devtools/checkpatches.sh +1 -1
-length=${DPDK_CHECKPATCH_LINE_LENGTH:-80}
+length=${DPDK_CHECKPATCH_LINE_LENGTH:-100}

This is my personnal settings for years.

[...]

doc/guides/contributing/coding_style.rst The rules and guidelines given in this document cannot cover every situation, so · line 24

Quoted 2 lines
doc/guides/contributing/coding_style.rst +1 -1
-Line length is recommended to be not more than 80 characters, including comments.
+Line length is recommended to be not more than 100 characters, including comments.

I think lines of 80 characters are reasonnable,
but I would not reject a patch because few lines are between 80 and 100.

I would reword the doc to reflect that flexibility:
"
Line length is recommended to be not more than 80 characters, including comments. The hard limit is 100 characters.
"