Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Can source folders be excluded from style check?

    Cinema 4D SDK
    c++ project tool
    2
    5
    871
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • fwilleke80F
      fwilleke80
      last edited by fwilleke80

      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

      www.frankwilleke.de
      Only asking personal code questions here.

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        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.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • fwilleke80F
          fwilleke80
          last edited by

          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

          www.frankwilleke.de
          Only asking personal code questions here.

          1 Reply Last reply Reply Quote 0
          • M
            m_adam
            last edited by m_adam

            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.

            MAXON SDK Specialist

            Development Blog, MAXON Registered Developer

            1 Reply Last reply Reply Quote 1
            • fwilleke80F
              fwilleke80
              last edited by fwilleke80

              Oh, cool! I didn't know it was possible to deactivate those via comments.
              Perfect, that should do it, thank you!

              Cheers,
              Frank

              www.frankwilleke.de
              Only asking personal code questions here.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post