I find it useful to rewrite and refactor java source files in order to come to really understand them. Of course, I don't want those source files to be a part of my project's source.But it seems like unless they're marked as source in the project structure dialog, they don't get any kind of formatting except the default formatting applied to them in the editor. I've looked in the configuration dialogs for formatting options , like a checkbox that says "apply formatting to all project files" or something but I don't see anything. Am I missing something? So far I have tried marking them as "resources" and "test" .