Ticket #1059 (closed RFC: wontfix)

Opened 12 years ago

Last modified 11 years ago

Run Parrot through cpplint.py

Reported by: petdance Owned by: petdance
Priority: minor Milestone:
Component: coding_standards Version: 1.6.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform: all

Description

The Google folks have a style guide:

 http://code.google.com/p/google-styleguide/

One of the tools they use on their C++ code is cpplint.py:

 http://google-styleguide.googlecode.com/svn/trunk/cpplint/

Let's throw it at the Parrot source and see what shakes loose.

Change History

  Changed 12 years ago by petdance

  • owner changed from jkeenan to petdance

  Changed 12 years ago by jkeenan

Is it C++-specific? How much (if any) C++ do we have in Parrot?

in reply to: ↑ description   Changed 12 years ago by jkeenan

Replying to petdance:

Let's throw it at the Parrot source and see what shakes loose.

Doesn't work on .c files:

$ python cpplint.py src/string/primitives.c 
Ignoring src/string/primitives.c; not a .cc or .h file
Done processing src/string/primitives.c
Total errors found: 0

Does work on .h files -- but they're coding standards are probably different from ours, so a lot of noise would be generated:

python cpplint.py ./src/string/charset/iso-8859-1.h
./src/string/charset/iso-8859-1.h:13:  #ifndef header guard has wrong style, please use: PARROT_SRC_STRING_CHARSET_ISO_8859_1_H_  [build/header_guard] [5]
./src/string/charset/iso-8859-1.h:42:  #endif line should be "#endif  // PARROT_SRC_STRING_CHARSET_ISO_8859_1_H_"  [build/header_guard] [5]
./src/string/charset/iso-8859-1.h:17:  Lines should be <= 80 characters long  [whitespace/line_length] [2]
./src/string/charset/iso-8859-1.h:39:  Lines should be <= 80 characters long  [whitespace/line_length] [2]
Done processing ./src/string/charset/iso-8859-1.h
Total errors found: 4

I suspect we would have to adapt it heavily to be useful.

kid51

follow-up: ↓ 5   Changed 12 years ago by dukeleto

We already have t/codingstd , we should improve and expand those tests instead of attempting to hack our standards into Google's style guide script.

in reply to: ↑ 4   Changed 12 years ago by petdance

Nobody's suggesting hacking our standards or their script. Just want to see if there's any value in a tool that obviously must work for them.

  Changed 12 years ago by coke

  • type changed from cage to RFC

follow-up: ↓ 8   Changed 11 years ago by NotFound

There is some value in this ticket? I think 14 months is RFC status without any comment is enough to see that no one cares.

in reply to: ↑ 7   Changed 11 years ago by jkeenan

Replying to NotFound:

There is some value in this ticket? I think 14 months is RFC status without any comment is enough to see that no one cares.

NotFound:

I agree with your line of thought. I think we can close the ticket.

If petdance or anyone else wants to pursue this line of inquiry, he/she can do a fork on github and report back to parrot-dev when meaningful results are obtained.

Thank you very much.

kid51

  Changed 11 years ago by NotFound

  • status changed from new to closed
  • resolution set to wontfix
Note: See TracTickets for help on using tickets.