Skip to content

Commit

Permalink
update project name
Browse files Browse the repository at this point in the history
  • Loading branch information
huhouhua committed Feb 9, 2024
1 parent a933787 commit 9cd6ff0
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ flycheck_*.el
# Output of backend and frontend
/_output
/_debug
addlicense
licctl

# Misc
.DS_Store
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GO := go
ROOT_PACKAGE := github.com/seacraft/addlicense
ROOT_PACKAGE := github.com/seacraft/licctl
ifeq ($(origin ROOT_DIR),undefined)
ROOT_DIR := $(shell pwd)
endif
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# Copyright check and add tools
[![Go Report Card](https://goreportcard.com/badge/github.com/seacraft/addlicense?)](https://goreportcard.com/report/github.com/seacraft/addlicense)
[![golangci badge](https://github.com/golangci/golangci-web/blob/master/src/assets/images/badge_a_plus_flat.svg)](https://golangci.com/r/github.com/seacraft/addlicense)
[![Build Status](https://travis-ci.com/seacraft/addlicense.svg?branch=main)](https://travis-ci.com/seacraft/addlicense)
[![release](https://img.shields.io/github/release-pre/seacraft/addlicense.svg)](https://github.com/seacraft/addlicense/releases)
[![Go Report Card](https://goreportcard.com/badge/github.com/seacraft/licctl?)](https://goreportcard.com/report/github.com/seacraft/licctl)
[![golangci badge](https://github.com/golangci/golangci-web/blob/master/src/assets/images/badge_a_plus_flat.svg)](https://golangci.com/r/github.com/seacraft/licctl)
[![Build Status](https://travis-ci.com/seacraft/licctl.svg?branch=main)](https://travis-ci.com/seacraft/licctl)
[![release](https://img.shields.io/github/release-pre/seacraft/licctl.svg)](https://github.com/seacraft/licctl/releases)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/mum4k/termdash/blob/main/LICENSE)
[![Releases](https://img.shields.io/github/downloads/seacraft/addlicense/total.svg)](https://github.com/seacraft/addlicense/releases)
[![Releases](https://img.shields.io/github/downloads/seacraft/licctl/total.svg)](https://github.com/seacraft/licctl/releases)


> English | [中文](README_zh.md)
## Install

```bash
$ go install github.com/seacraft/addlicense
$ go install github.com/seacraft/licctl
```

Help information

```bash
$ addlicense -h
Usage: addlicense [flags] pattern [pattern ...]
$ licctl -h
Usage: licctl [flags] pattern [pattern ...]

The program ensures source code files have copyright license headers
by scanning directory patterns recursively.
Expand Down Expand Up @@ -74,11 +74,11 @@ $ cat ./boilerplate.txt
2. Check whether the file contains the copyright header
```bash
$ addlicense --check -f ./boilerplate.txt . --skip-dirs=third_party
$ licctl --check -f ./boilerplate.txt . --skip-dirs=third_party
```
3. Add copyright header to files missing copyright header
```bash
$ addlicense -v -f ./boilerplate.txt . --skip-dirs=third_party
$ licctl -v -f ./boilerplate.txt . --skip-dirs=third_party
```
20 changes: 10 additions & 10 deletions README_zh.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# 授权头检查和添加工具
[![Go Report Card](https://goreportcard.com/badge/github.com/seacraft/addlicense?)](https://goreportcard.com/report/github.com/seacraft/addlicense)
[![golangci badge](https://github.com/golangci/golangci-web/blob/master/src/assets/images/badge_a_plus_flat.svg)](https://golangci.com/r/github.com/seacraft/addlicense)
[![Build Status](https://travis-ci.com/seacraft/addlicense.svg?branch=main)](https://travis-ci.com/seacraft/addlicense)
[![release](https://img.shields.io/github/release-pre/seacraft/addlicense.svg)](https://github.com/seacraft/addlicense/releases)
[![Go Report Card](https://goreportcard.com/badge/github.com/seacraft/licctl?)](https://goreportcard.com/report/github.com/seacraft/licctl)
[![golangci badge](https://github.com/golangci/golangci-web/blob/master/src/assets/images/badge_a_plus_flat.svg)](https://golangci.com/r/github.com/seacraft/licctl)
[![Build Status](https://travis-ci.com/seacraft/licctl.svg?branch=main)](https://travis-ci.com/seacraft/licctl)
[![release](https://img.shields.io/github/release-pre/seacraft/licctl.svg)](https://github.com/seacraft/licctl/releases)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/mum4k/termdash/blob/main/LICENSE)
[![Releases](https://img.shields.io/github/downloads/seacraft/addlicense/total.svg)](https://github.com/seacraft/addlicense/releases)
[![Releases](https://img.shields.io/github/downloads/seacraft/licctl/total.svg)](https://github.com/seacraft/licctl/releases)


> [English](README.md) | 中文
## 安装

```bash
$ go install github.com/seacraft/addlicense
$ go install github.com/seacraft/licctl
```

帮助信息为:

```bash
$ addlicense -h
Usage: addlicense [flags] pattern [pattern ...]
$ licctl -h
Usage: licctl [flags] pattern [pattern ...]

The program ensures source code files have copyright license headers
by scanning directory patterns recursively.
Expand Down Expand Up @@ -74,11 +74,11 @@ $ cat ./boilerplate.txt
2. 检查文件中是否都有该版权头
```bash
$ addlicense --check -f ./boilerplate.txt . --skip-dirs=third_party
$ licctl --check -f ./boilerplate.txt . --skip-dirs=third_party
```
3. 给缺失版权头的文件添加版权头
```bash
$ addlicense -v -f ./boilerplate.txt . --skip-dirs=third_party
$ licctl -v -f ./boilerplate.txt . --skip-dirs=third_party
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/seacraft/addlicense
module github.com/seacraft/licctl

go 1.21

Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"golang.org/x/sync/errgroup"
)

const helpText = `Usage: addlicense [flags] pattern [pattern ...]
const helpText = `Usage: licctl [flags] pattern [pattern ...]
The program ensures source code files have copyright license headers
by scanning directory patterns recursively.
Expand Down Expand Up @@ -218,7 +218,7 @@ func main() {
return errors.New("missing license header")
}
} else {
modified, err := addLicense(f.path, f.mode, t, data)
modified, err := addlicense(f.path, f.mode, t, data)
if err != nil {
fmt.Printf("%s: %v\n", f.path, err)

Expand Down Expand Up @@ -295,7 +295,7 @@ func walk(ch chan<- *file, start string) {
})
}

func addLicense(path string, fmode os.FileMode, tmpl *template.Template, data *copyrightData) (bool, error) {
func addlicense(path string, fmode os.FileMode, tmpl *template.Template, data *copyrightData) (bool, error) {
var lic []byte
var err error
lic, err = licenseHeader(path, tmpl, data)
Expand Down

0 comments on commit 9cd6ff0

Please sign in to comment.