add common GPL headers

This commit is contained in:
Jeff Carr 2025-02-01 11:38:22 -06:00
parent 899cbb3483
commit 22e0cbe022
Notes: Jeff Carr 2025-02-01 12:59:28 -06:00
// `autogen:go.mod`

module go.wit.com/apps/utils/wit-test

go 1.21

toolchain go1.23.4

require (
	go.wit.com/dev/alexflint/arg v1.5.5
	go.wit.com/gui v0.22.23
	go.wit.com/lib/debugger v0.22.6
	go.wit.com/lib/gadgets v0.22.6
	go.wit.com/lib/gui/logsettings v0.22.6
	go.wit.com/lib/gui/shell v0.22.23
	go.wit.com/lib/protobuf/forgepb v0.0.71
	go.wit.com/lib/protobuf/gitpb v0.0.71
	go.wit.com/log v0.22.10
)

require (
	github.com/destel/rill v0.6.0 // indirect
	github.com/go-cmd/cmd v1.4.3 // indirect
	go.wit.com/dev/alexflint/scalar v1.2.4 // indirect
	go.wit.com/lib/protobuf/zoopb v0.0.22 // indirect
	go.wit.com/widget v1.1.27 // indirect
	google.golang.org/protobuf v1.36.4 // indirect
)

// `autogen:go.sum`

github.com/destel/rill v0.6.0 h1:8MQRzS6k0akKmwNZFahKIhG1dkBeNxMoWKSfOxkaJNw=
github.com/destel/rill v0.6.0/go.mod h1:srKuXzvGqINUEGYR5b/iwvW+L9/S35RxVHWGYbXNoO4=
github.com/go-cmd/cmd v1.4.3 h1:6y3G+3UqPerXvPcXvj+5QNPHT02BUw7p6PsqRxLNA7Y=
github.com/go-cmd/cmd v1.4.3/go.mod h1:u3hxg/ry+D5kwh8WvUkHLAMe2zQCaXd00t35WfQaOFk=
github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg=
github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
go.wit.com/dev/alexflint/arg v1.5.5 h1:c4jgIb4OvHjnCMRNSjOa1sNLl6WDxV6tIkMVezR9hCk=
go.wit.com/dev/alexflint/arg v1.5.5/go.mod h1:nH3F6TJDaAUgnLkC0WgRN/H047YfN1TYKaWPYr6B8lo=
go.wit.com/dev/alexflint/scalar v1.2.4 h1:zmBeEkObwz1lcelwfGNYP2GS6SQ9e0tdv7JdHwMZEEk=
go.wit.com/dev/alexflint/scalar v1.2.4/go.mod h1:kCNO1Fo5LnnK6+qa+zYhP5fdgfC1C+vx1ti99Md+FAM=
go.wit.com/gui v0.22.23 h1:bvbnV+o2YWeZsLT859PYUZKfouJepnNFwqbE17CfOmU=
go.wit.com/gui v0.22.23/go.mod h1:BLB9puy4uNoJYA4WB5LBc7aB3mXavgh4mVLB36WuiTk=
go.wit.com/lib/debugger v0.22.6 h1:30FgxpFKwZZ3rmqwtQFHCZ8QwHGn7Xa48BVbkJeQ7Kc=
go.wit.com/lib/debugger v0.22.6/go.mod h1:r+D+NZ4pkp+nA/2nAA7UerWswwqBjVDkiFjWPWUhJJM=
go.wit.com/lib/gadgets v0.22.6 h1:7ajBzCRftjZ170aa+QLhxuIL4eXK76kFLATD3tkxcKY=
go.wit.com/lib/gadgets v0.22.6/go.mod h1:3eMOLDlSyY6vohlUheTCB74PwYxhpHkX1KGZXTSOgdE=
go.wit.com/lib/gui/logsettings v0.22.6 h1:XZnERj6H+rTaD2nLFdb87qg14u9d2W4Ax4ObV8dmWO4=
go.wit.com/lib/gui/logsettings v0.22.6/go.mod h1:Njyvv5mgUU/d5BPi2Mcb660ZZiNB2DbF9X6DFChuBDo=
go.wit.com/lib/gui/shell v0.22.23 h1:U6Njsme2NU7ntcopcSXHD9bNYZzzeQueSTRB/L1YrgE=
go.wit.com/lib/gui/shell v0.22.23/go.mod h1:K6+ULaS8xQFcsi1QoWHY1+PM/vS+IRSyJvbnJF9GyIQ=
go.wit.com/lib/protobuf/forgepb v0.0.71 h1:6RQKVf+/u8IAP8+oGs9X7mmuESGJ/J+YvZ0dufkZaeA=
go.wit.com/lib/protobuf/forgepb v0.0.71/go.mod h1:ZcN1JxtHJ7SfUb1qezy3e68DOP5f99u8YBY2Twmwhhk=
go.wit.com/lib/protobuf/gitpb v0.0.71 h1:90qbXNITjZjgbdHHulfX+NajTgvjoO+D6LDdbdXH3c4=
go.wit.com/lib/protobuf/gitpb v0.0.71/go.mod h1:zlLM/+9vajrXNVbczpoyYIraLokZ6My47wDgqo9Gobg=
go.wit.com/lib/protobuf/zoopb v0.0.22 h1:tAFwRGMepMz+AsEehtwW5mO7ljXspQCcY3qTOT/EgXI=
go.wit.com/lib/protobuf/zoopb v0.0.22/go.mod h1:iEec6TXYJjaeShv+vOfCuw/3uWnfm35ongl19T2l0v0=
go.wit.com/log v0.22.10 h1:rlSgaYjvxbpcmi9UBQO3ESmbd/jiyFdRQFoGOvpCEUc=
go.wit.com/log v0.22.10/go.mod h1:4uNPFBqhsAh8zNF+zxVEmC3c/9AZ8JeTfUUvRpddvLQ=
go.wit.com/widget v1.1.27 h1:Yd+qp6GZVwLiTTepShXSeWSDqjaCxLyfhU0ch2FrPZ8=
go.wit.com/widget v1.1.27/go.mod h1:OXIdWk7GhVJRLnHTvf45LbPNXGYG/JjbkfnmXtkoiYE=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM=
google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=

// `autogen:`
10 changed files with 52 additions and 14 deletions

View File

@ -27,5 +27,8 @@ goimports:
clean:
rm -f go.*
gpl:
wit-test --witcom
check-git-clean:
@git diff-index --quiet HEAD -- || (echo "Git repository is dirty, please commit your changes first"; exit 1)

View File

@ -1,3 +1,6 @@
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0
package main
/*

View File

@ -1,3 +1,6 @@
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0
package main
import (

View File

@ -1,3 +1,6 @@
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0
package main
import (

View File

@ -1,3 +1,6 @@
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0
package main
import (

View File

@ -1,3 +1,7 @@
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0
package main
import (
@ -24,6 +28,7 @@ func doWITCOM() {
}
}
// add a common header for WIT files
// add a common header for WIT files
func addCommonHeader(filename string) error {
@ -34,13 +39,7 @@ func addCommonHeader(filename string) error {
return err
}
pf, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
defer pf.Close()
if err != nil {
log.Info("file open error. permissions?", filename, err)
return err
}
var newfile string
var start bool = true
var found bool
var done bool
@ -52,10 +51,10 @@ func addCommonHeader(filename string) error {
start = false
if strings.Contains(line, "WIT.COM") {
found = true
continue
} else {
fmt.Fprintln(pf, line)
newfile += fmt.Sprintln(line)
}
continue
}
// dump every other comment
@ -64,16 +63,28 @@ func addCommonHeader(filename string) error {
} else {
found = false
}
// print the header once
if !done {
fmt.Fprintln(pf, "// Copyright 2017-2025 WIT.COM Inc. All rights reserved.")
fmt.Fprintln(pf, "// Use of this source code is governed by the GPL 3.0")
fmt.Fprintln(pf, "")
fmt.Fprintln(pf, line)
newfile += fmt.Sprintln("// Copyright 2017-2025 WIT.COM Inc. All rights reserved.")
newfile += fmt.Sprintln("// Use of this source code is governed by the GPL 3.0")
newfile += fmt.Sprintln("")
done = true
}
fmt.Fprintln(pf, line)
newfile += fmt.Sprintln(line)
}
pf, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
if err != nil {
log.Info("file open error. permissions?", filename, err)
return err
}
// trim trailing empty lines from the new file
newfile = strings.TrimSpace(newfile)
fmt.Fprintln(pf, newfile)
pf.Close()
return nil
}

View File

@ -1,3 +1,6 @@
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0
package main
import (

View File

@ -1,3 +1,6 @@
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0
package main
import (

View File

@ -1,3 +1,6 @@
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0
package main
import (

View File

@ -1,3 +1,6 @@
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0
package main
import (