PBS Pro coding standards update


#1

We would like to poll the community on some proposed additions to the PBS Pro coding standards located here: https://pbspro.atlassian.net/wiki/spaces/DG/pages/5537826/Coding+Standards

Please post a reply if you find any of the following proposed updates unacceptable.

Do not attempt to align variable names or types with whitespace when declaring multiple variables. Use a single space between variable names and types.

Do this:
int foo;
char *bar;

Not this:
int     foo;
char *bar;

Place one space on either side of the ‘=’ when assigning variable values. This includes variables initialized in “for” loops. This should also be done for operations including ‘+’, ‘*’, ‘<’, ‘>’, etc. Do not use spaces between increment/decrement operators or pointer operations such as ‘*’, ‘&’ and ‘->’.

Do this:
foo = 0;
for (bar = 0; bar < 100; bar++) {}

Not this:
foo=0;
for (bar=0; bar<100; bar++) {}


#2

Final call for comments regarding the coding standards updates.


#3

I don’t mind the proposal. But does this mean that if I add one line to a file, I will have to correct the whole file to make it match the coding standard?
Or will the files all get updated at one time to match the new standard? Or…


#4

We’ve had coding standards for some time now, and much of our current code base does not conform. If you’re adding new code, then the code must conform to the standards. It is not required that a developer fix areas of the code they have not modified, but it is appreciated.


#5

Thanks for the confirmation @mkaro