mongo-go-driver - PR #2428: GODRIVER-3957 Fix long lines in bson/decoder_example_test.go and expand check-fmt to cover both *_example_test.go and *_examples_test.go files

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Duplicate
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      linborland has created PR #2428: GODRIVER-3957 Fix long lines in bson/decoder_example_test.go and expand check-fmt to cover both *_example_test.go and *_examples_test.go files in mongo-go-driver

      Issue Text:
      GODRIVER-3957

        1. Summary

      The check-fmt tool is updated to check both *_examples_test.go and *_example_test.go files.
      All lines in bson/decoder_example_test.go are wrapped at 80 characters or fewer, excluding lines containing URI-like strings in comments (e.g. // https://(https://github.com/mongodb/mongo-go-driver/compare/master...linborland:godriver3957?expand=1)...) or testable example output markers (e.g. // Output: ...), which are intentionally exempt from the line length limit.

        1. Background & Motivation

      The check-fmt tool checks that example test files have lines wrapped at 80 characters to keep them readable when rendered on pkg.go.dev. Currently, as part of the migration of check_fmt.sh to a Go program (GODRIVER-3936(https://jira.mongodb.org/browse/GODRIVER-3936)), the check only covers files matching the plural form *_examples_test.go. It should also cover the singular form *_example_test.go, as both are used in the repo for example tests. Expanding the check to cover *_example_test.go also exposes existing line length violations in bson/decoder_example_test.go.

            Assignee:
            Unassigned
            Reporter:
            TPM Jira Automations Bot
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: