golic

command module
v0.4.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

README

golic

license management tool, injecting licenses into source code

golic inject -c="2021 MyCompany ltd." --dry

Screenshot 2021-03-08 at 11 42 52

Running from commandline

create .licignore in project root

# Ignore everything
*

# But not these files...
!Dockerfile*
!Makefile
!*.go

# ...even if they are in subdirectories
!*/

Install and run GOLIC

# GO 1.16 
go install github.com/AbsaOSS/golic@v0.4.7
golic inject -c="2021 MyCompany ltd."

Usage

Available Commands:
  help        Help about any command
  inject      Injects license
  version     Print the version number of Golic

Flags:
  -h, --help      help for this command
  -v, --verbose   verbose output

Usage inject:
   inject [flags]

Flags:
  -p, --config-path string   path to the local configuration overriding config-url (default ".golic.yaml")
  -u, --config-url string    default config URL (default "https://raw.githubusercontent.com/AbsaOSS/golic/main/.golic.yaml")
  -c, --copyright string     company initials entered into license (default "2021 MyCompany")
  -d, --dry                  dry run
  -h, --help                 help for inject
  -l, --licignore string     .licignore path (default ".licignore")
  -x, --modified-exit        If enabled, exits with status 1 when any file is modified. The settings is used by CI
  -t, --template string      license key (default "apache2")


Global Flags:
  -v, --verbose   verbose output

Configuration

Golic uses master configuration by default. The master configuration is accessible from the URL, and if you need to change it, use the -u flag or create PR. However, it is much better to create a local configuration that overrides the master configuration settings. All you have to do is create a .golic.yaml file in the project root, or use the -p flag. Example below overrides master configuration by custom licenses

# .golic.yaml 
golic:
  licenses:
    apache2: |
      Copyright {{copyright}}

      This is my custom license text
    apacheX: |
      Copyright {{copyright}}
      for more details see https://github.com/mycompany/myproject/LICENSE

Documentation

Overview

Copyright 2021 Absa Group Limited

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic

Directories

Path Synopsis
impl
utils
log

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL