Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
Add missing copyright headers; remove old hook
Browse files Browse the repository at this point in the history
  • Loading branch information
l50 committed Apr 12, 2024
1 parent 7dc1cfe commit c06611d
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 182 deletions.
7 changes: 0 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,6 @@ repos:
entry: .hooks/go-licenses.sh check_forbidden
files: '\.go$'

- id: generate-docs
name: Update package docs
language: script
entry: .hooks/generate-docs.sh
require_serial: true
files: '\.go$'

- id: go-copyright
name: Ensure all go files have the copyright header
language: script
Expand Down
19 changes: 19 additions & 0 deletions cmd/storedXSSDos.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
Copyright © 2024-present, Meta Platforms, Inc. and affiliates
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

package cmd

import (
Expand Down
138 changes: 0 additions & 138 deletions magefiles/README.md

This file was deleted.

56 changes: 19 additions & 37 deletions magefiles/magefile.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
//go:build mage

/*
Copyright © 2024-present, Meta Platforms, Inc. and affiliates
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

package main

import (
Expand All @@ -11,11 +30,8 @@ import (
"github.com/fatih/color"
"github.com/l50/goutils/v2/dev/lint"
mageutils "github.com/l50/goutils/v2/dev/mage"
"github.com/l50/goutils/v2/docs"
"github.com/l50/goutils/v2/git"
"github.com/l50/goutils/v2/str"
"github.com/l50/goutils/v2/sys"
"github.com/spf13/afero"

// mage utility functions

Expand Down Expand Up @@ -163,37 +179,3 @@ func RunPreCommit() error {

return nil
}

// GeneratePackageDocs creates documentation for the various packages
// in the project.
//
// Example usage:
//
// ```go
// mage generatepackagedocs
// ```
//
// **Returns:**
//
// error: An error if any issue occurs during documentation generation.
func GeneratePackageDocs() error {
fs := afero.NewOsFs()

repoRoot, err := git.RepoRoot()
if err != nil {
return fmt.Errorf("failed to get repo root: %v", err)
}
sys.Cd(repoRoot)

repo := docs.Repo{
Owner: "l50",
Name: "goutils/v2",
}

templatePath := filepath.Join("magefiles", "tmpl", "README.md.tmpl")
if err := docs.CreatePackageDocs(fs, repo, templatePath); err != nil {
return fmt.Errorf("failed to create package docs: %v", err)
}

return nil
}
19 changes: 19 additions & 0 deletions magefiles/testing.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
//go:build mage
// +build mage

/*
Copyright © 2024-present, Meta Platforms, Inc. and affiliates
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

package main

import (
Expand Down

0 comments on commit c06611d

Please sign in to comment.