Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Respect canonical import comments #1017

Merged
merged 8 commits into from
Oct 7, 2017

Commits on Aug 14, 2017

  1. Cleanup: fix typos

    rtfb committed Aug 14, 2017
    Configuration menu
    Copy the full SHA
    d6140bd View commit details
    Browse the repository at this point in the history
  2. Cleanup: simplify switch statement, reuse build.IsLocalImport

    We already import and use build package here, so there's no harm in
    reuse. The code is both shorter and more readable.
    rtfb committed Aug 14, 2017
    Configuration menu
    Copy the full SHA
    0e41a07 View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2017

  1. Implement import comment extraction

    Look for import comments following the package declaration. The
    implementation of findImportComment() very closely follows go/build's
    findImportComment().
    
    Tests and validation against importRoot to come in a later commit.
    rtfb committed Aug 15, 2017
    Configuration menu
    Copy the full SHA
    19c7f60 View commit details
    Browse the repository at this point in the history
  2. Canonical path extraction: tests and error checking

    Added a check and an error type for importRoot to be a prefix of
    canonical import path, tests for the new code paths.
    
    Fixed one unrelated bug along the way:
        Sprintf("%q", strings.Join(strs, "\", \""))
    doesn't work as intended, since the %q verb will escape the inner
    doublequotes.
    rtfb committed Aug 15, 2017
    Configuration menu
    Copy the full SHA
    242e387 View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2017

  1. Configuration menu
    Copy the full SHA
    90d2a5e View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2017

  1. Fix NonCanonicalImportRoot test

    rtfb committed Sep 10, 2017
    Configuration menu
    Copy the full SHA
    1853dc3 View commit details
    Browse the repository at this point in the history

Commits on Oct 6, 2017

  1. Configuration menu
    Copy the full SHA
    47e42c7 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2017

  1. Fix lint

    rtfb committed Oct 7, 2017
    Configuration menu
    Copy the full SHA
    611e64b View commit details
    Browse the repository at this point in the history