Skip to content

Commit ad26036

Browse files
authored
Merge pull request #109 from smallstep/herman/fix-load-vintage-defaults
Handle `LoadVintage` error when contexts are not in use
2 parents 7ae858b + 39dd46c commit ad26036

File tree

14 files changed

+219
-34
lines changed

14 files changed

+219
-34
lines changed

pkg/blackfriday/block.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// Functions to parse block-level elements.
1212
//
1313

14+
//nolint:gocritic,revive,ineffassign,gosimple,wastedassign // ignore blackfriday
1415
package blackfriday
1516

1617
import (

pkg/blackfriday/block_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// Unit tests for block parsing
1212
//
1313

14+
//nolint:all
1415
package blackfriday
1516

1617
import (

pkg/blackfriday/esc_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//nolint:all
12
package blackfriday
23

34
import (

pkg/blackfriday/helpers_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// Helper functions for unit testing
1212
//
1313

14+
//nolint:all
1415
package blackfriday
1516

1617
import (

pkg/blackfriday/html.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
//
1414
//
1515

16+
//nolint:gocritic,unused,revive // ignore blackfriday
1617
package blackfriday
1718

1819
import (

pkg/blackfriday/inline.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// Functions to parse inline elements.
1212
//
1313

14+
//nolint:gocritic,whitespace,wastedassign,revive // ignore blackfriday
1415
package blackfriday
1516

1617
import (
@@ -721,7 +722,9 @@ func linkEndsWithEntity(data []byte, linkEnd int) bool {
721722
}
722723

723724
// hasPrefixCaseInsensitive is a custom implementation of
724-
// strings.HasPrefix(strings.ToLower(s), prefix)
725+
//
726+
// strings.HasPrefix(strings.ToLower(s), prefix)
727+
//
725728
// we rolled our own because ToLower pulls in a huge machinery of lowercasing
726729
// anything from Unicode and that's very slow. Since this func will only be
727730
// used on ASCII protocol prefixes, we can take shortcuts.

pkg/blackfriday/inline_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// Unit tests for inline parsing
1212
//
1313

14+
//nolint:all
1415
package blackfriday
1516

1617
import (

pkg/blackfriday/markdown.go

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// Distributed under the Simplified BSD License.
66
// See README.md for details.
77

8+
//nolint:gocritic,wastedassign,unused,revive,govet // ignore blackfriday
89
package blackfriday
910

1011
import (
@@ -345,8 +346,8 @@ func WithNoExtensions() Option {
345346
// In Markdown, the link reference syntax can be made to resolve a link to
346347
// a reference instead of an inline URL, in one of the following ways:
347348
//
348-
// * [link text][refid]
349-
// * [refid][]
349+
// - [link text][refid]
350+
// - [refid][]
350351
//
351352
// Usually, the refid is defined at the bottom of the Markdown document. If
352353
// this override function is provided, the refid is passed to the override
@@ -363,21 +364,25 @@ func WithRefOverride(o ReferenceOverrideFunc) Option {
363364
// block of markdown-encoded text.
364365
//
365366
// The simplest invocation of Run takes one argument, input:
366-
// output := Run(input)
367+
//
368+
// output := Run(input)
369+
//
367370
// This will parse the input with CommonExtensions enabled and render it with
368371
// the default HTMLRenderer (with CommonHTMLFlags).
369372
//
370373
// Variadic arguments opts can customize the default behavior. Since Markdown
371374
// type does not contain exported fields, you can not use it directly. Instead,
372375
// use the With* functions. For example, this will call the most basic
373376
// functionality, with no extensions:
374-
// output := Run(input, WithNoExtensions())
377+
//
378+
// output := Run(input, WithNoExtensions())
375379
//
376380
// You can use any number of With* arguments, even contradicting ones. They
377381
// will be applied in order of appearance and the latter will override the
378382
// former:
379-
// output := Run(input, WithNoExtensions(), WithExtensions(exts),
380-
// WithRenderer(yourRenderer))
383+
//
384+
// output := Run(input, WithNoExtensions(), WithExtensions(exts),
385+
// WithRenderer(yourRenderer))
381386
func Run(input []byte, opts ...Option) []byte {
382387
r := NewHTMLRenderer(HTMLRendererParameters{
383388
Flags: CommonHTMLFlags,
@@ -491,35 +496,35 @@ func (p *Markdown) parseRefsToAST() {
491496
//
492497
// Consider this markdown with reference-style links:
493498
//
494-
// [link][ref]
499+
// [link][ref]
495500
//
496-
// [ref]: /url/ "tooltip title"
501+
// [ref]: /url/ "tooltip title"
497502
//
498503
// It will be ultimately converted to this HTML:
499504
//
500-
// <p><a href=\"/url/\" title=\"title\">link</a></p>
505+
// <p><a href=\"/url/\" title=\"title\">link</a></p>
501506
//
502507
// And a reference structure will be populated as follows:
503508
//
504-
// p.refs["ref"] = &reference{
505-
// link: "/url/",
506-
// title: "tooltip title",
507-
// }
509+
// p.refs["ref"] = &reference{
510+
// link: "/url/",
511+
// title: "tooltip title",
512+
// }
508513
//
509514
// Alternatively, reference can contain information about a footnote. Consider
510515
// this markdown:
511516
//
512-
// Text needing a footnote.[^a]
517+
// Text needing a footnote.[^a]
513518
//
514-
// [^a]: This is the note
519+
// [^a]: This is the note
515520
//
516521
// A reference structure will be populated as follows:
517522
//
518-
// p.refs["a"] = &reference{
519-
// link: "a",
520-
// title: "This is the note",
521-
// noteID: <some positive int>,
522-
// }
523+
// p.refs["a"] = &reference{
524+
// link: "a",
525+
// title: "This is the note",
526+
// noteID: <some positive int>,
527+
// }
523528
//
524529
// TODO: As you can see, it begs for splitting into two dedicated structures
525530
// for refs and for footnotes.

pkg/blackfriday/markdown_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// Unit tests for full document parsing and rendering
1212
//
1313

14+
//nolint:all
1415
package blackfriday
1516

1617
import "testing"

pkg/blackfriday/node.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//nolint:gocritic,unused // ignore blackfriday
12
package blackfriday
23

34
import (

0 commit comments

Comments
 (0)