Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2921

Create a MongoDB Go Driver linter

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Unknown Unknown
    • None
    • None
    • None
    • None

    Description

      Create a linter that reports when the MongoDB Go Driver is used in erroneous or error-prone ways. Specifically, cover cases that are detectable by static analysis, but don't cause compilation failures.

      Proposed MongoDB Go Driver linter checks:

      1. Check for improper usage of bson.E as a nested document instead of bson.D.
      2. Check for improper passing of multiple options structs to some APIs (only Go Driver 2.x).
      3. Check for un-closed sessions and transactions.
      4. Check for operations inside WithSession or WithTransaction not using the SessionContext.

      Definition of done:

      • Create a Go linter that checks for some or all of the proposed problems above.

      Open questions:

      • What is the full list of checks?
      • Should we create a new repository or release the linter as a submodule from the Go driver repository?

      Attachments

        Activity

          People

            Unassigned Unassigned
            matt.dale@mongodb.com Matt Dale
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: