Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add some features to DC plugin #32

Open
wants to merge 3 commits into
base: ghc-9.2.8
Choose a base branch
from
Open

add some features to DC plugin #32

wants to merge 3 commits into from

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.

1 participant