Skip to content

Conversation

@Yashasvi-JP
Copy link
Collaborator

@Yashasvi-JP Yashasvi-JP commented Oct 1, 2024

Following changes were made in this PR:

  • Read prefixPath form plugin options, previously it was defined as a constant.
    Can be set like this

    -fplugin=DC.DefaultCheck -fplugin-opt=DC.DefaultCheck:{"prefixPath":"./.juspay/dc/test/"}

  • Add option in yaml config file to specify which condition to check in function check.
    Test Examples
    • Case when conditionToCheck is [], it checks all conditions, in every path.
      Config File:
      tag: FunctionCheck
      contents:
        listOfRestrictedFuns:
          - "throwErr"
          - "throwException"
        moduleNameToCheck: "Main"
        funNameToCheck: "testParentFunction"
        conditionToCheck: []
        pathsToConsider: []
        pathsToIgnore: []
        modulesToIgnore: []
      

      Errors:

    • Case when conditionToCheck is ["Right"], it checks only Right cases.
      Config File:
      tag: FunctionCheck
      contents:
        listOfRestrictedFuns:
          - "throwErr"
          - "throwException"
        moduleNameToCheck: "Main"
        funNameToCheck: "testParentFunction"
        conditionToCheck: 
          - "Right"
        pathsToConsider: []
        pathsToIgnore: []
        modulesToIgnore: []
      

      Errors:

  • Add option in yaml config file to specify which paths to check for the given condition.
    Test Examples
    • Case when pathsToConsider is ["test/PathsToConsider"], it checks all conditions in that path only.
      Config File:
      tag: FunctionCheck
      contents:
        listOfRestrictedFuns:
          - "throwErr"
          - "throwException"
        moduleNameToCheck: "PathsToConsider.Considered"
        funNameToCheck: "consideredFun"
        conditionToCheck: []
        pathsToConsider: 
          - "test/PathsToConsider"
        pathsToIgnore: []
        modulesToIgnore: []
      

      Errors:

  • Add option in yaml config file to specify which paths to ignore for the given condition.
    Test Examples
    • Case when pathsToIgnore is ["test/IgnorePath"], it ignores that path.
      Config File:
      tag: FunctionCheck
      contents:
        listOfRestrictedFuns:
          - "throwErr"
          - "throwException"
        moduleNameToCheck: "Main"
        funNameToCheck: "testParentFunction"
        conditionToCheck: []
        pathsToConsider: []
        pathsToIgnore: 
          - "test/IgnorePath"
        modulesToIgnore: []
      

      Errors:

  • Add option in yaml config file to specify which modules to ignore for the given condition.
    Test Examples
    • Errors when modulesToIgnore is ["IgnorePath.IgnoreModule"], it ignores that module.
      Config File
      tag: FunctionCheck
      contents:
        listOfRestrictedFuns:
          - "throwErr"
          - "throwException"
        moduleNameToCheck: "Main"
        funNameToCheck: "testParentFunction"
        conditionToCheck: []
        pathsToConsider: []
        pathsToIgnore: []
        modulesToIgnore: 
          - "IgnorePath.IgnoreModule"
      

      Errors:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants