Skip to content

Commit aa35358

Browse files

File tree

6 files changed

+64
-2
lines changed

6 files changed

+64
-2
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ indent_style = space
2525
indent_size = 2
2626
indent_style = space
2727

28-
[*.go]
28+
[*.{go,mod}]
2929
indent_style = tab
3030

3131
[*.java]

workflow-templates/assets/deploy-cobra-mkdocs-versioned-poetry/.gitkeep

Whitespace-only changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: "3"
2+
3+
tasks:
4+
docs:gen:
5+
desc: Generate command reference
6+
dir: ./docsgen
7+
cmds:
8+
# docs will generate examples using os.Args[0] so we need to call
9+
# the generator `arduino-lint`
10+
- go build -o arduino-lint{{exeExt}}
11+
# we invoke `arduino-lint` like this instead of `./arduino-lint` to remove
12+
# the `./` chars from the examples
13+
- PATH=. arduino-lint ../docs/commands
14+
- task: docs:format
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module github.com/arduino/arduino-lint/docsgen
2+
3+
go 1.14
4+
5+
replace github.com/arduino/arduino-lint => ../
6+
7+
require (
8+
github.com/arduino/arduino-lint v0.0.0
9+
github.com/spf13/cobra v1.1.1
10+
)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to license@arduino.cc.
15+
16+
// Package main generates Markdown documentation for the Arduino Lint CLI.
17+
package main
18+
19+
import (
20+
"os"
21+
22+
"github.com/arduino/arduino-lint/internal/cli"
23+
"github.com/spf13/cobra/doc"
24+
)
25+
26+
func main() {
27+
if len(os.Args) < 2 {
28+
print("error: Please provide the output folder argument")
29+
os.Exit(1)
30+
}
31+
32+
cli := cli.Root()
33+
cli.DisableAutoGenTag = true // Disable addition of auto-generated date stamp
34+
err := doc.GenMarkdownTree(cli, os.Args[1])
35+
if err != nil {
36+
panic(err)
37+
}
38+
}

workflow-templates/assets/shared/.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ indent_style = space
2525
indent_size = 2
2626
indent_style = space
2727

28-
[*.go]
28+
[*.{go,mod}]
2929
indent_style = tab
3030

3131
[*.java]

0 commit comments

Comments
 (0)