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

Implement --extern-location #72603

Merged
merged 3 commits into from
Feb 8, 2021
Merged

Implement --extern-location #72603

merged 3 commits into from
Feb 8, 2021

Commits on Feb 7, 2021

  1. Add --extern-loc to augment unused crate dependency diagnostics

    This allows a build system to indicate a location in its own dependency
    specification files (eg Cargo's `Cargo.toml`) which can be reported
    along side any unused crate dependency.
    
    This supports several types of location:
     - 'json' - provide some json-structured data, which is included in the json diagnostics
         in a `tool_metadata` field
     - 'raw' - emit the provided string into the output. This also appears as a json string in
         `tool_metadata`.
    
    If no `--extern-location` is explicitly provided then a default json entry of the form
    `"tool_metadata":{"name":<cratename>,"path":<cratepath>}` is emitted.
    jsgf committed Feb 7, 2021
    Configuration menu
    Copy the full SHA
    82ccb65 View commit details
    Browse the repository at this point in the history
  2. Implement Encoder for Diagnostic manually

    ...so we can skip serializing `tool_metadata` if it hasn't been set.
    This makes the output a bit cleaner, and avoiding having to update a
    bunch of unrelated tests.
    jsgf committed Feb 7, 2021
    Configuration menu
    Copy the full SHA
    50572d6 View commit details
    Browse the repository at this point in the history
  3. Make sure all fields are accounted for in encode_fields!

    This will make sure the encoder will get updated if any new fields are
    added to Diagnostic.
    jsgf committed Feb 7, 2021
    Configuration menu
    Copy the full SHA
    91d8c3b View commit details
    Browse the repository at this point in the history