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

chore: excerpt investigation #162

Merged
merged 4 commits into from
Nov 24, 2022
Merged

chore: excerpt investigation #162

merged 4 commits into from
Nov 24, 2022

Conversation

cfabianski
Copy link
Collaborator

@cfabianski cfabianski commented Nov 24, 2022

Description

Include context around classification

Example with temp.rb

# This is a comment
logger.info(
  "user info are:",
  user.email,
  user.address
)
[
  {
    "detector_type": "detect_ruby_logger",
    "source": {
      "column_number": 6,
      "filename": ".",
      "language": "Ruby",
      "language_type": "programming",
      "line_number": 4,
      "text": null
    },
    "type": "custom_classified",
    "value": {
      "classification": {
        "data_type": {
          "category_uuid": "cef587dd-76db-430b-9e18-7b031e1a193b",
          "name": "Email Address",
          "uuid": "22e24c62-82d3-4b72-827c-e261533331bd"
        },
        "decision": {
          "reason": "known_pattern",
          "state": "valid"
        },
        "name": "email"
      },
      "field_name": "email",
      "field_type": "",
      "field_type_simple": "unknown",
      "object_name": "user",
      "parent": {
        "content": "logger.info(\n  \"user info are:\",\n  user.email,\n  user.address\n)",
        "line_number": 2
      }
    }
  },
  {
    "detector_type": "detect_ruby_logger",
    "source": {
      "column_number": 6,
      "filename": ".",
      "language": "Ruby",
      "language_type": "programming",
      "line_number": 5,
      "text": null
    },
    "type": "custom_classified",
    "value": {
      "classification": {
        "data_type": {
          "category_uuid": "cef587dd-76db-430b-9e18-7b031e1a193b",
          "name": "Physical Address",
          "uuid": "5a80a938-6fb2-4d9a-9c47-8d377e036506"
        },
        "decision": {
          "reason": "known_pattern",
          "state": "valid"
        },
        "name": "address"
      },
      "field_name": "address",
      "field_type": "",
      "field_type_simple": "unknown",
      "object_name": "user",
      "parent": {
        "content": "logger.info(\n  \"user info are:\",\n  user.email,\n  user.address\n)",
        "line_number": 2
      }
    }
  },
  {
    "detector_type": "ruby",
    "source": {
      "column_number": 8,
      "filename": ".",
      "language": "Ruby",
      "language_type": "programming",
      "line_number": 2,
      "text": null
    },
    "type": "schema_classified",
    "value": {
      "field_name": "info",
      "field_type": "",
      "field_type_simple": "unknown",
      "object_name": "logger"
    }
  },
  {
    "detector_type": "ruby",
    "source": {
      "column_number": 8,
      "filename": ".",
      "language": "Ruby",
      "language_type": "programming",
      "line_number": 4,
      "text": null
    },
    "type": "schema_classified",
    "value": {
      "classification": {
        "data_type": {
          "category_uuid": "cef587dd-76db-430b-9e18-7b031e1a193b",
          "name": "Email Address",
          "uuid": "22e24c62-82d3-4b72-827c-e261533331bd"
        },
        "decision": {
          "reason": "known_pattern",
          "state": "valid"
        },
        "name": "email"
      },
      "field_name": "email",
      "field_type": "",
      "field_type_simple": "unknown",
      "object_name": "user"
    }
  },
  {
    "detector_type": "ruby",
    "source": {
      "column_number": 8,
      "filename": ".",
      "language": "Ruby",
      "language_type": "programming",
      "line_number": 5,
      "text": null
    },
    "type": "schema_classified",
    "value": {
      "classification": {
        "data_type": {
          "category_uuid": "cef587dd-76db-430b-9e18-7b031e1a193b",
          "name": "Physical Address",
          "uuid": "5a80a938-6fb2-4d9a-9c47-8d377e036506"
        },
        "decision": {
          "reason": "known_pattern",
          "state": "valid"
        },
        "name": "address"
      },
      "field_name": "address",
      "field_type": "",
      "field_type_simple": "unknown",
      "object_name": "user"
    }
  }
]

Checklist

  • I've added test coverage that shows my fix or feature works as expected.
  • I've updated or added documentation if required.
  • I've included usage information in the description if CLI behavior was updated or added.
  • PR title follows Conventional Commits format

@cfabianski cfabianski changed the title Spike/excerpt investigation chore: excerpt investigation Nov 24, 2022
}

type Parent struct {
LineNumber int `json:"line_number,omitempty" yaml:"line_number,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a comment here that it is starting line number?

@cfabianski cfabianski merged commit 989fdcb into main Nov 24, 2022
@cfabianski cfabianski deleted the spike/excerpt-investigation branch November 24, 2022 14:07
@elsapet
Copy link
Contributor

elsapet commented Nov 24, 2022

👏 👏 👏

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.

None yet

3 participants