telefonicaid / fiware-orion

Context Broker and CEF building block for context data management, providing NGSI interfaces.
https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md
GNU Affero General Public License v3.0
210 stars 265 forks source link

Modifications in the orion style guide conformance script #966

Open kzangeli opened 9 years ago

kzangeli commented 9 years ago

The python script we use to check orion style guide conformance comes from google, I think. The style we want is similar but not exactly the same. It would be VERY good to be able to modify the script to our special needs.

Examples:

  1. catch () is treated as if it were a function and the script complains about a space between function name and parenthesis. catch is not a function ...
  2. We want the opening { on a separate line, this is not checked by the script
  3. Aligned variables/parameters. No check whatsoever in the script
  4. etc.

From #532 (addressing the same topic):

The python script we use to ensure we follow the style guide could be improved with more rules. In Orion, we have decided to always use '{}' for 'if', 'for', 'do' and 'while', also for one-liners. However, the style guide enforcer script doesn't detect this.

Another thing that is not detected are commented lines that end in whitespace. Code lines ending in whitespace are detected, but not commented lines.

Effort: 3 man day

fgalan commented 9 years ago

I understand that item 1 has been fixed in PR #975: https://github.com/telefonicaid/fiware-orion/pull/975/files#diff-4abdbb2a75f622bb69ca7ae19beee7c6R1538

fgalan commented 9 years ago

Duplicated in https://github.com/telefonicaid/fiware-orion/issues/532 ?