Creating a module

You create modules in the Project Management area of Validate.

  1. If you're not already viewing the Projects list, click Projects at the top left.
  2. Click your project in the list. The project details appear on the right.
  3. Click Modules in the project details.
  4. Click Create a new module.
  5. In Module name, enter a name for your module, for example, My Tools.

    Module names cannot exceed 64 characters, and cannot contain apostrophes (') or double quotes (") at the same time.

  6. In Access, if access control has been set up, you can control who can view source code in this module. Note that users must also have the "Access source files" permission for the project.
    • Allow all sets a generic rule allowing anyone to see source code in this module.
    • Deny all sets a generic rule preventing anyone from seeing source code in this module.
    • The Allow user field allows you to grant source code access to specific users.
    • The Deny user field allows you to deny source code access to specific users.

    For example, to allow only jsmith access to source code in a module, choose Deny all from the drop-down menu and enter jsmith in the Allow user field.

  7. In Pattern Type, select Glob or Regex.
    Standard regex characters are supported, including:
    • .* to match zero or more occurrences of any number of paths including / or \
    • .+ to match one or more occurrences of any number of paths including / or \
    • [^/]* to match any single file or directory in Linux
    • [^\\]* to match any single file or directory in Windows
    • \\ to match Window path separator
    • / to match Linux path separator
    • . to match any single character including dot
    • \\. to match literal dot
  8. Example 1

    Given path: /space/workspaces/cvs/ccvs.1.11.18/diff/diff.c

    .*diff.*

    This includes the text diff in any part of the path.

    .*/ccvs.1.11.18/diff/diff.c

    This returns a match, since a dot followed by asterisk matches any number of paths (in this case, /space/workspaces/cvs).

    [^/]*/ccvs.1.11.18/diff/diff.c

    This does not return a match, since [^/]* matches anything except forward slash i.e., only a single file or directory.

    Example 2

    Given path: /space/workspaces/cvs/ccvs.1.11.18/diff/diff.c

    /space/workspaces/cvs/ccvs.1.11.[^/]*/diff/diff.c

    This matches a specific file under the path /space/workspaces/cvs/ccvs.1.11.18/ regardless of the minor version number, since [^/]* matches the text 18.

    /space/workspaces/cvs/ccvs.1.11..*

    This matches all files under the same path.

    Example 3

    Given path: /space/workspaces/cvs/ccvs.1.11.18/diff/diff.c

    .*/ccvs.1.11.18/.*/s[^/]*

    This matches all files that start with the character s under ccvs.1.11.18 and any intermediate directory.

    .*/ccvs.1.11.18/.*/[^/]*s[^/]*

    This matches all files that contain the character s under ccvs.1.11.18 and any intermediate directory.

    Example 4

    Given path: /a/b*c/d/

    /a/b\*c/d/

    The escaped asterisk \* is used to search for a path contains the * character, since asterisks can be characters in path specifications in Windows and Linux.

    Given path: C:\path1\path2\dir\file*abc.c

    C:\\path1\\path2\\dir\\file\*abc.c

    Example 5

    Given path: /a/b!c/d/

    /a/b!c/d/

    In regex, ! doesn't need to be escaped.

    Example 6

    Given path: /**/sub!*folder/test.c

    /\*\*/sub!\*folder/test.c

    Each asterisk in the contiguous string must each be escaped with a backslash.

    Example 7

    Given Linux file paths: /space/workspaces/cvs/ccvs.1.11.18/diff/file1.c and /space/workspaces1/cvs/ccvs.1.11.18/diff1/file2.c

    .*/cvs/.*

    Given Windows file paths: C:\space\workspaces\cvs\ccvs.1.11.18\diff\file.c and C:\space\workspaces\cvs\ccvs.1.11.19\diff\file1.c

    .*\\cvs\\.*

    This will match because .* can match zero or any number of paths.

    Example 8

    Given Linux file paths: /space/workspaces/cvs/ccvs.1.11.18/diff/file1.c and /space/workspaces1/cvs/ccvs.1.11.18/diff/file2.c

    .*/diff/[^/]*

    Given windows file paths: C:\space\workspaces\cvs\ccvs.1.11.18\diff\file2.c and C:\space\workspaces\cvs\ccvs.1.11.18\diff\file1.c

    .*\\diff\\[^\\]*

    This will match because [^/]* can match any single file or directory name.

    Example 9

    Given path: /space/workspaces/cvs/ccvs.1.11.18/DifF/diff.c

    .*/(?i)diff/diff.c

    This will match because diff is matched case insensitive.

    Example 10

    If a regex character is used in the path then make sure to escape it with backslash. For example:

    Given file path: path1/path2+dir/file.c

    .*path2\+dir/file.c

    This will match because here + is used as literal character.

    Given path: path1/(bracket|fun)/file.c

    .*\(bracket\|fun\)/file.c

    This will match because (, | and ) are escaped with backslash.

    Given paths: path1/path2/filecc and path1/path2/file.c

    .*path2/file.c

    This will match because dot can match anything.

    Given path: path1/path2/filecc

    .*path2/file\\.c

    This will not match because dot is treated as literal in the pattern.

  9. In Path patterns, you can specify paths in one of two ways; by using tree selection or by specifying path patterns:
    Path patterns and tree selection are not updated in real time. If you switch between two selections, changes are not reflected until you save the module.
    • If you prefer to use tree selection, select the Use tree option. A file tree appears, where you can specifically select folders or files that you want to include as part of the module.
    • Alternatively, you can use path patterns. In the Path patterns field, enter an absolute file path or path pattern. This is the default behavior. Click add to add more file paths to this module.
    • Whenever possible, use path patterns that include regular expressions so that you avoid creating a very long list of paths. There is a limit to the length of path the system can process; as a best practice, limit the length of a path to 30 000 characters.

    Normal regex style wild cards may allow certain paths to be included or omitted from an access rule. Single * and double ** asterisk path matching provides enough specificity in path selection to allow deterministic access permission control over individual paths in the customer code base. You can use asterisks as wildcards if the path to your source files changes from build to build.

    • Use a single asterisk * to search non-recursively, which will match search terms within the current path level only.
    • Use two asterisks ** to search recursively, which will match search terms within the current path level and its subdirectories. Use an escaped asterisk !* to search for a path that contains the * character.

    Use an escaped exclamation point !! to search for a path that contains the ! character.

    The * and ** wild cards will also match the * and ! characters .

    Example 1

    Given the file path /space/workspaces/cvs/ccvs.1.11.18/diff/diff.c:

    diff  
    

    This includes the text diff in any part of the path.

    **/ccvs.1.11.18/diff/diff.c   
    

    This returns a match, since a double asterisk matches any number of paths (in this case, /space/workspaces/cvs).

    */ccvs.1.11.18/diff/diff.c
    

    This does not return a match, since a single asterisk matches only a single file or directory.

    **/diff/**

    The double asterisk at the start matches /space/workspaces/cvs/ccvs.1.11.18 and the double asterisk at the end matches all files after the diff directory .

    Example 2

    Given the file path /space/workspaces/cvs/ccvs.1.11.18/diff/diff.c:

    /space/workspaces/cvs/ccvs.1.11.*/diff/diff.c

    This matches a specific file under the path /space/workspaces/cvs/ccvs.1.11.18/ regardless of the minor version number, since * matches the text 18.

    /space/workspaces/cvs/ccvs.1.11.**

    This matches all files under the same path.

    Example 3

    Given the file path /space/workspaces/cvs/ccvs.1.11.18/diff/diff.c:

    **/ccvs.1.11.18/**/s*

    This matches all files that start with the character s under ccvs.1.11.18 and any intermediate directory.

    **/ccvs.1.11.18/**/*s*

    This matches all files that contain the character s under ccvs.1.11.18 and any intermediate directory.

    Example 4

    Given the file path /a/b*c/d/:

    /a/b!*c/d/

    The escaped asterisk !* is used to search for a path contains the * character, since asterisks can be characters in path specifications in Windows and Linux.

    Example 5

    Given the file path /a/b!c/d/:

    /a/b!!c/d/

    The escaped exclamation point !! is used to search for a path that contains the ! character.

    Example 6

    Given the file path /a/b!*c/d/:

    /a/b!!!*c/d/

    Since the folder path contains a contiguous string of characters, each unique character in the path must be escaped with an exclamation point.

    Given the file path /**/sub!*folder/test.c:

    /!*!*/sub!!!*folder/test.c

    Each asterisk in the contiguous string must each be escaped with an exclamation point.

  10. Use the Tags field to add information that will be helpful for filtering the module list later.
  11. Click Create to save your new module.