Skip to content

About

This is a Python web application partially evaluates the coding style of students' .cpp and .h files in a CS 101 class.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

 
 

Latest commit

 

History

659 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Tests Python 3.12+ License: MIT

235CppStyle

This is a Python web application that partially evaluates the coding style of students' .cpp and .h files for CSCI 235, a computer science course at Charleston Southern University.

This is a fork of cppStyle, used at the University of Michigan.

Requires Python 3.12+. Dependencies are managed via pyproject.toml using standard Python packaging tools — no Pipenv or requirements.txt needed.

Installation

First, create and activate a virtual environment (recommended):

python -m venv .venv

# Linux / macOS
source .venv/bin/activate

# Windows (CMD)
.venv\Scripts\activate

Then install the appropriate dependency set for your use case:

CLI only (run_local.py / run_local_for_parsing.py)

Installs the core dependencies (cpplint, pyparsing) needed to grade files from the command line:

pip install -e .

Web application (run.py)

Installs core dependencies plus Flask, Werkzeug, and Gunicorn:

pip install -e ".[web]"

Development (tests + web)

Installs everything including pytest:

pip install -e ".[web,dev]"

Running the Application

Command-line grader

python ./run_local.py path/to/file.cpp
python ./run_local_for_parsing.py path/to/file.cpp

Web application (local dev server)

python ./run.py

Web application (debug mode — Windows)

SET FLASK_APP=run.py
SET FLASK_DEBUG=1
python -m flask run

Web application (debug mode — Linux / macOS)

export FLASK_APP=run.py
export FLASK_DEBUG=1
python -m flask run

Run Regression Tests

Install the dev extras (see above), then:

  • Execute all the tests.
    pytest
  • Stop at the first failed assertion.
    pytest -x
  • Run one specific test.
    pytest -k test_good_operator_spacing

About

This is a Python web application partially evaluates the coding style of students' .cpp and .h files in a CS 101 class.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages