[no subject]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



autopep8 autoformatter is also nice (and, up to some point, black),
as it auto-corrects whitespace issues, but there's two things I don't 
like on them:

1. its coding style on lines, creating function calls with open 
   parenthesis:

	-    parser.add_argument("-n", "-nosymbol", "--nosymbol", action='append',
	-                         help=NOSYMBOL_DESC)
	+    parser.add_argument(
	+        "-n", "-nosymbol", "--nosymbol", action="append", help=NOSYMBOL_DESC
	+    )

2. whitespace removal on aligned consts:

	-    STATE_INLINE_NA     = 0 # not applicable ($state != STATE_INLINE)
	-    STATE_INLINE_NAME   = 1 # looking for member name (@foo:)
	-    STATE_INLINE_TEXT   = 2 # looking for member documentation
	-    STATE_INLINE_END    = 3 # done
	-    STATE_INLINE_ERROR  = 4 # error - Comment without header was found.
	-                            # Spit a warning as it's not
	-                            # proper kernel-doc and ignore the rest.
	+    STATE_INLINE_NA = 0  # not applicable ($state != STATE_INLINE)
	+    STATE_INLINE_NAME = 1  # looking for member name (@foo:)
	+    STATE_INLINE_TEXT = 2  # looking for member documentation	
	+    STATE_INLINE_END = 3  # done
	+    STATE_INLINE_ERROR = 4  # error - Comment without header was found.

What I do here is from time to time manually run them and cherry-pick
only changes that sounds good to my personal taste.

It is probably a good idea to define a coding style and perhaps add
some config files (like a .pep8 file) to have a single coding style for
future code, letting scripts/checkpatch.pl to run pylint and/or some
other coding style tool(s).

Thanks,
Mauro





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux