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

chore: add readme linter #10916

Merged
merged 22 commits into from
Apr 19, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
874f974
Add readme linter
reimda Mar 25, 2022
140dc55
print markdown line number of failed assertion
reimda Mar 25, 2022
032d5ed
assert header text matches regexp
reimda Mar 25, 2022
802697e
Check for required sectionsDisable long line check
reimda Mar 28, 2022
30dfdd4
Let each plugin type have its own rules.Use file path to determine pl…
reimda Mar 29, 2022
01ebf85
Move to tools/readme_linter
reimda Mar 30, 2022
87adb2a
Remove empty file
reimda Mar 30, 2022
6e7961e
Remove commented code
reimda Mar 30, 2022
e3ce0b7
remove more commented code
reimda Mar 30, 2022
0994a58
Add rule that first section must have a paragraph with some text
reimda Apr 2, 2022
c31bf07
Make long line check apply only in paragraphs
reimda Apr 3, 2022
f0bff92
Move plugin type to separate file
reimda Apr 3, 2022
c5e76ee
Check that config section has a toml fenced code block
reimda Apr 3, 2022
d0af22e
Fix revive errors
reimda Apr 3, 2022
3e462b8
Parse markdown tables to avoid checking for long lines in them
reimda Apr 4, 2022
c7fb673
check for in-repo absolute links
reimda Apr 5, 2022
1b53473
Check that lines are available before getting line number
reimda Apr 8, 2022
1ec35dd
Prevent panic when looking up line number
reimda Apr 12, 2022
6db81bd
Added docs on running the linter
reimda Apr 12, 2022
fc23a53
Add build instructions and remove user directory from examples
reimda Apr 14, 2022
529ad78
Add command line option to print the location in source code of faile…
reimda Apr 19, 2022
9c4fdc2
Don't (do not) use contractions in messages
reimda Apr 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove commented code
  • Loading branch information
reimda committed Apr 14, 2022
commit 6e7961eab4e337af46ab3c10b19631f194703a9f
14 changes: 0 additions & 14 deletions tools/readme_linter/assert.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ type T struct {
fails int
}

// func (t *T) assert(b bool) {
// if b {
// return
// }
// t.fails += 1

// t.printRule()
// t.printFile()
// }

// called by all assert functions that involve a node
func (t *T) printFailedAssert(n ast.Node, format string, args ...interface{}) {
t.printFile(n)
Expand Down Expand Up @@ -98,8 +88,6 @@ func (t *T) assertKind(expected ast.NodeKind, n ast.Node) {
}

t.printFailedAssert(n, "expected %s, have %s", expected.String(), n.Kind().String())

//n.Dump(t.markdown, 0)
}

func (t *T) assertFirstChildRegexp(expectedPattern string, n ast.Node) {
Expand Down Expand Up @@ -133,6 +121,4 @@ func (t *T) assertHeadingLevel(expected int, n ast.Node) {
}

t.printFailedAssert(n, "expected header level %d, have %d", expected, h.Level)

//n.Dump(t.markdown, 0)
}
1 change: 0 additions & 1 deletion tools/readme_linter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ func checkFile(filename string, pluginType plugin) error {
if err != nil {
return err
}
//fmt.Printf("\n")
}
tester.printPassFail()

Expand Down