Adding a README to the third-party docs and renaming a file (#1204)

This commit is contained in:
Mike Arpaia 2017-02-10 15:11:36 -07:00 committed by GitHub
parent 728c2c3475
commit c16230dac8
5 changed files with 16 additions and 11 deletions

5
docs/third-party/README.md vendored Normal file
View file

@ -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.

View file

@ -1,4 +1,4 @@
Third-Party Software
Third-Party Licenses
====================
| Name | License |

View file

@ -1,8 +1,8 @@
Third-Party Software
Third-Party Licenses
====================
| Name | License |
| ---- | ------- |
{{- range .}}
| [{{.Name}}]({{.SourceURL}}) | [{{.License}}]({{getLicenseURL .License }}) |
{{- end -}}
{{- end -}}

View file

@ -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)
}
}

View file

@ -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()