From c16230dac8eeed2143a9a2aea015e9dc14924bf6 Mon Sep 17 00:00:00 2001 From: Mike Arpaia Date: Fri, 10 Feb 2017 15:11:36 -0700 Subject: [PATCH] Adding a README to the third-party docs and renaming a file (#1204) --- docs/third-party/README.md | 5 +++++ docs/third-party/{dependencies.md => licenses.md} | 2 +- .../{dependencies.md.tmpl => licenses.md.tmpl} | 4 ++-- tools/lint_license/lint_license.go | 12 ++++++------ tools/lint_license/lint_license_test.go | 4 ++-- 5 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 docs/third-party/README.md rename docs/third-party/{dependencies.md => licenses.md} (99%) rename tools/lint_license/{dependencies.md.tmpl => licenses.md.tmpl} (82%) diff --git a/docs/third-party/README.md b/docs/third-party/README.md new file mode 100644 index 0000000000..a001c44f2b --- /dev/null +++ b/docs/third-party/README.md @@ -0,0 +1,5 @@ +Third Party Software +==================== + +Like most modern web applications, Kolide uses a number of third-party software as application dependencies. To learn more about the licenses of these dependencies, see the [Third-Party Licenses](./licenses.md) document. + diff --git a/docs/third-party/dependencies.md b/docs/third-party/licenses.md similarity index 99% rename from docs/third-party/dependencies.md rename to docs/third-party/licenses.md index e58604457d..f3e00a4589 100644 --- a/docs/third-party/dependencies.md +++ b/docs/third-party/licenses.md @@ -1,4 +1,4 @@ -Third-Party Software +Third-Party Licenses ==================== | Name | License | diff --git a/tools/lint_license/dependencies.md.tmpl b/tools/lint_license/licenses.md.tmpl similarity index 82% rename from tools/lint_license/dependencies.md.tmpl rename to tools/lint_license/licenses.md.tmpl index 06f3ec9953..08dd56e5b1 100644 --- a/tools/lint_license/dependencies.md.tmpl +++ b/tools/lint_license/licenses.md.tmpl @@ -1,8 +1,8 @@ -Third-Party Software +Third-Party Licenses ==================== | Name | License | | ---- | ------- | {{- range .}} | [{{.Name}}]({{.SourceURL}}) | [{{.License}}]({{getLicenseURL .License }}) | -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/tools/lint_license/lint_license.go b/tools/lint_license/lint_license.go index 595ae9e419..20121acdb4 100644 --- a/tools/lint_license/lint_license.go +++ b/tools/lint_license/lint_license.go @@ -21,13 +21,13 @@ import ( // This script is intended to be run from the root of the Kolide repo. All // paths are relative to that directory. const configPath = "./tools/lint_license/license_settings.yaml" -const templatePath = "./tools/lint_license/dependencies.md.tmpl" -const templateName = "dependencies.md.tmpl" +const templatePath = "./tools/lint_license/licenses.md.tmpl" +const templateName = "licenses.md.tmpl" const glideLockPath = "./glide.lock" const nodeModulesPath = "./node_modules" const vendorPath = "./vendor" const jsSourceURLBase = "https://www.npmjs.com/package/" -const generatedMarkdownPath = "./docs/third-party/dependencies.md" +const generatedMarkdownPath = "./docs/third-party/licenses.md" // settings defines the config options for this script type settings struct { @@ -250,7 +250,7 @@ func checkLicenses(config settings, deps []dependency) []dependency { return incompatible } -func writeDependenciesMarkdown(config settings, deps []dependency, out io.Writer) error { +func writeLicensesMarkdown(config settings, deps []dependency, out io.Writer) error { funcs := template.FuncMap{ "getLicenseURL": func(license string) string { return config.AllowedLicenses[license] @@ -329,8 +329,8 @@ func main() { } defer out.Close() - err = writeDependenciesMarkdown(config, append(jsDeps, goDeps...), out) + err = writeLicensesMarkdown(config, append(jsDeps, goDeps...), out) if err != nil { - log.Fatal("error writing dependencies markdown: ", err) + log.Fatal("error writing licenses markdown: ", err) } } diff --git a/tools/lint_license/lint_license_test.go b/tools/lint_license/lint_license_test.go index 63674f965c..5f005da85b 100644 --- a/tools/lint_license/lint_license_test.go +++ b/tools/lint_license/lint_license_test.go @@ -55,7 +55,7 @@ func TestCheckLicenses(t *testing.T) { } } -func TestWriteDependenciesMarkdown(t *testing.T) { +func TestWriteLicensesMarkdown(t *testing.T) { out := &bytes.Buffer{} config := settings{ AllowedLicenses: map[string]string{ @@ -72,7 +72,7 @@ func TestWriteDependenciesMarkdown(t *testing.T) { {Name: "manx", SourceURL: "manx_url", License: "MIT"}, } - err := writeDependenciesMarkdown(config, deps, out) + err := writeLicensesMarkdown(config, deps, out) require.Nil(t, err) md := out.String()