Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jellyterra/copyright-gen
Automatically update copyright headers for source files.
https://github.com/jellyterra/copyright-gen
Last synced: 1 day ago
JSON representation
Automatically update copyright headers for source files.
- Host: GitHub
- URL: https://github.com/jellyterra/copyright-gen
- Owner: jellyterra
- License: mit
- Created: 2024-05-06T16:51:03.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-05-08T08:21:41.000Z (6 months ago)
- Last Synced: 2024-05-08T09:33:41.316Z (6 months ago)
- Language: Go
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# copyright-gen
Automatically update copyright headers for source files.It is simple and designed for sharing between different editors and plugins.
### Setup
```shell
$ go install github.com/jellyterra/copyright-gen
```### Usage
```
Usage: copyright-gen profile source-file...
``````shell
$ copyright-gen cxx.json main.cpp lib.cpp
```## Template
The program uses Go template engine.
Predefined values:
- ```$.name``` System profile name
- ```$.year``` This month
- ```$.month``` This year
- ```$.day``` TodayFor example:
```gotemplate
Copyright {{ $.year }} {{ $.name }}
Use of this source code form is governed under the MIT license.
```## Profile
*Profile* is the generator configuration encoded in JSON.
```json
{
"template": "Copyright {{ $.year }} {{ $.name }}\nUse of this source code form is governed under the MIT license."
}
```> [!NOTE]
> Preset profiles are available in repo [copyright-gen-profiles](https://github.com/jellyterra/copyright-gen-profiles) .**Java, C, C++** etc.
```json
{
"prefix": "/*",
"suffix": " */",
"line_prefix": " ",
"template": "..."
}
```
```java
/*
Copyright 2024 Jelly Terra
Use of this source code form is governed under the MIT license.
*/public class Main {}
```**Go, Rust** etc.
```json
{
"line_prefix": "// ",
"template": "..."
}
```
```go
// Copyright 2024 Jelly Terra
// Use of this source code form is governed under the MIT license.package main
```**Bash, Python** etc.
```json
{
"line_prefix": "# ",
"template": "..."
}
```
```shell
# Copyright 2024 Jelly Terra
# Use of this source code form is governed under the MIT license.echo ""
```**HTML, XML** etc.
```json
{
"line_prefix": "",
"template": "..."
}
```
```html```