3 ms·
In the case of this tool, it seem that "code quality" means "formatted the way this tool's author believes is correct." I disagree with this definition. When I
by delinka 14y ago
In the case of this tool, it seem that "code quality" means "formatted the way this tool's author believes is correct." I disagree with this definition.
When I think of code quality, I consider things like:
- consistent memory management practices
- consistent use of accessor methods vs. direct ivar access
- descriptive method, function, and variable names
- commentary to describe caveats and tricky functionality
Those first two (as well as formatting concerns) can be handled by tools while the next two are very "human" and subjective.
- RyanZAG 14y ago- consistent use of accessor methods vs. direct ivar access This is your second thing you think of when you think of code quality? I think we're right back at "formatted the way this tool's author believes is correct." Your other 3 points are good though, and I'd also add - uses generic code only where required, and uses exceptional code only when needed
- delinka 14y agoI did not express a preference for either. I expect consistency in quality code. Anecdotally, being inconsistent when writing code leads to more bugs reports.
- jrogers65 14y agoCame here to say exactly this. Here's a sample of the output: https://codeq.io/github/yakxxx/memek/master/crawler/tests/test_comment_crawler.py https://codeq.io/github/yakxxx/memek/master/crawler/tests/te... > Trailing whitespace (1, 29, 34) Missing optional whitespace around operator (6, 48) Blank line contains whitespace (11, 15, 19, 23—25, 33, 44—45, 53—55) Continuation line under-indented for visual indent (17, 21) No spaces around keyword / parameter equals (17, 21, 48) Line too long (100 > 79 characters) (21) Too many blank lines (3) (26) Continuation line over-indented for hanging indent (29, 34) Missing whitespace after ':' (30—31, 35—36) Line too long (81 > 79 characters) (30, 35) Continuation line indentation is not a multiple of four (30, 35) Line too long (80 > 79 characters) (31, 36) Closing bracket does not match indentation of opening bracket's line (38) Too many blank lines (2) (46) Line too long (91 > 79 characters) (47) Blank line at end of file (55) Not to mention that it's quite simple to have your CI server perform these kinds of checks already.
- raverbashing 14y agoIf I'm not mistaken these are the exact messages pep8 produces. So it's basically pep8 as a service.