Can source folders be excluded from style check?
-
Hi,
I have some header and cpp files here that don't pass the source processor's style check. Since it's source code that would be very cumbersome to adjust, and since it's code written by somebody else, I wonder if I can simply exclude a folder (or certain files) from the style check.
Cheers,
Frank -
Hi @fwilleke80 unfortunately there is no option to do it, you can either disable the stylecheck or enable it.
One question raised, and you probably have your own reason, but why don't you put these files outside of your source and thread them as an external library?
Cheers,
Maxime. -
Hi Maxime,
I usually do use external libraries. However, if I just want to try out some open source code I found somewhere, especially if it's just one or two files, I don't want to create a whole library project for it. Especially since I usually use external libraries as GIT submodules, so the library folder with its source and project files would be in a subfolder of my plugin, and the Project Tool always puts everything in one project.
Yeah, so, long story short, I just want to add a file that's absolutely not in Cinema 4D code style to my project. I guess I'll have to deactivate the whole style checking then. Pity. I usually like it.
Cheers,
Frank -
Hi @fwilleke80 here are the possibilities:
Create a comment to disable stylecheck locally
// stylecheck.naming=false .... code .... // stylecheck.naming=true
Unfortunately, it doesn't work for all kinds of warnings described in ProjectTool - Style Check. And you can't use
stylecheck=false
.
Here a list of style check you can redefine:- stylecheck.max-linecount
- stylecheck.naming
- stylecheck.using
- stylecheck.domains
- stylecheck.whitespace
- stylecheck.indentation
- stylecheck.enum-class
- stylecheck.enum-registration
- stylecheck.void-paramlist
- stylecheck.newline-for-substatement
- stylecheck.case-break
- stylecheck.no-whitespace
- stylecheck.supercall
- stylecheck.explicit
- stylecheck.ambiguouscalls
Some others may work I don't have a clear list.
Use Maxon Macro
- MAXON_WARN_MUTE_FUNCTION_LENGTH Mute warning if function is larger than 500 lines (similar to stylecheck.max-linecount=1000)
- MAXON_WARN_MUTE_NAMING: Mute warning if the naming scheme doesn't match (similar to stylecheck.naming=false).
- MAXON_WARN_MUTE_UNUSED: mute warning if a function/variable is not used.
- MAXON_WARN_UNUSED_CLASS: same as previous but for classes.
Use pragma warning
While it's not the best way, you can use pragma to disable error, for more information see MSDN - Pragma Warning.
Hope this helps.
Cheers,
Maxime. -
Oh, cool! I didn't know it was possible to deactivate those via comments.
Perfect, that should do it, thank you!Cheers,
Frank