PSx

Home Assignments Lecture Blog Resources Discussion Group

Refactor and cpplint

This assignment is an opportunity to make up lost points on a prior assignment, and to gain experience using Google's cpplint code style tool.

The assignment

  • Pick any prior assignment
  • Get all code files to pass the tests done by cpplint
  • Package them up and submit

cpplint

Google's style guide is here: http://google-styleguide.googlecode.com/svn/trunk/cppguide.html

The cpplint.py file can be retrieved from http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py

Save the cpplint.py file on your machine, and then:

chmod +x cpplint.py
sudo mv cpplint.py /usr/local/bin

Now, you can style-check a file using cpplint.py as an executable:

cpplint.py filename

Alternately, you could run it using Python:

python cpplint.py filename

Using cpplint

We've agreed to turn off certain warnings. At present, you may run with:

cpplint.py --filter=-runtime/references,-build/header_guard --extensions=cpp,hpp

Package your work

  1. Put your files in the subdirectory called psx.
  2. Create a file called psx-readme.txt. The first line of this file must contain the name of the assignment, by itself, e.g. ps1 or ps3b. In the rest of the file, explain which changes you made to the original homework.
  3. Use the tar command from the parent directory of your psx to compress your directory structure:
tar czvf <archive-file-name>.tar.gz psx

Submit your work

Submit via Bottlenose as follows:
Martin section (201): https://grader.cs.uml.edu/assignments/492
Grinberg section (202): https://grader.cs.uml.edu/assignments/491