I'm currently working in an eLearning platform, and I'm trying to add some PEP8 validation to the assignment solutions students are submitting to the system in order to give then some extra feedback about how good or bad the solution they proposed is.
I found that using the python pep8 package it's not that simple to check PEP8 errors just in a chunk of code (in my case, it would be the posted solution to the assignment), without specifying any path to a specific file in the filesystem.
Is it actually possible or the pep8 library doesn't allow it? Of course I could save the posted solution in a tmp file and run the validation from there, but I would like to avoid this extra step.
Did anyone have the same issue?
How do I wrap a string in a file in Python?. The fact that both solutions useStringIOdoesn't mean that both questions are the same. The problematic here was fully related to thepep8module. There was even an answer written by @Hugh Bothwell that doesn't involveStringIOat all. Sorry @TigerhawkT3 but I think this is not a duplicated question (actually I've checked before writing it).