Skip to content

Commit

Permalink
Apply and enforce file-level license headers (#440)
Browse files Browse the repository at this point in the history
* Apply and enforce file-level license headers

Use `mattermost-govet` to ensure each file begins with the appropriate header, then fix all instances for built source code.

```
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
```

Note that this renames `LICENSE` to `LICENSE.txt` purely to align on the
copyright messaging across repos.

* bundle LICENSE.txt and NOTICE.txt if they exist

* updated NOTICE.txt and configuration

* rm duplicate Copyrights

* updated files
  • Loading branch information
lieut-data authored Feb 3, 2025
1 parent a3d4962 commit 382bb17
Show file tree
Hide file tree
Showing 171 changed files with 371 additions and 105 deletions.
28 changes: 28 additions & 0 deletions .config/notice-file/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Notice.txt File Configuration

We are automatically generating Notice.txt by using first-level dependencies of the project. The related pipeline uses `config.yaml` stored in this folder.


## Configuration

Sample:

```
title: "Mattermost Playbooks"
copyright: "©2015-present Mattermost, Inc. All Rights Reserved. See LICENSE for license information."
description: "This document includes a list of open source components used in Mattermost Playbooks, including those that have been modified."
search:
- "go.mod"
- "client/go.mod"
dependencies: []
devDependencies: []
```

| Field | Type | Purpose |
| :-- | :-- | :-- |
| title | string | Field content will be used as a title of the application. See first line of `NOTICE.txt` file. |
| copyright | string | Field content will be used as a copyright message. See second line of `NOTICE.txt` file. |
| description | string | Field content will be used as notice file description. See third line of `NOTICE.txt` file. |
| dependencies | array | If any dependency name mentioned, it will be automatically added even if it is not a first-level dependency. |
| devDependencies | array | If any dependency name mentioned, it will be added when it is referenced in devDependency section. |
| search | array | Pipeline will search for package.json/go.mod files mentioned here. Globstar format is supported ie. `x/**/go.mod`. |
9 changes: 9 additions & 0 deletions .config/notice-file/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: "Mattermost Microsoft Calendar Plugin"
copyright: "©2019-present Mattermost, Inc. All Rights Reserved. See LICENSE.txt for license information."
description: "This document includes a list of open source components used in the plugin, including those that have been modified."
search:
- "go.mod"
- "webapp/package.json"
dependencies: []
devDependencies: []
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ jobs:
plugin-ci:
uses: mattermost/actions-workflows/.github/workflows/plugin-ci.yml@main
secrets: inherit
with:
golang-version: "1.22"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ server/manifest.go
.DS_Store
.npminstall
.idea

# notice
.notice-work
File renamed without changes.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ install-go-tools:
@echo Installing go tools
$(GO) install github.com/golangci/golangci-lint/cmd/[email protected]
$(GO) install gotest.tools/[email protected]
$(GO) install github.com/mattermost/mattermost-govet/v2@3f08281c344327ac09364f196b15f9a81c7eff08

## Runs golangci-lint and eslint.
.PHONY: check-style
Expand All @@ -185,6 +186,7 @@ ifneq ($(HAS_SERVER),)
@echo Running golangci-lint
$(GO) vet ./...
$(GOBIN)/golangci-lint run ./...
$(GO) vet -vettool=$(GOBIN)/mattermost-govet -license -license.year=2019 ./...
endif

## Builds the server, if it exists, for all supported architectures, unless MM_SERVICESETTINGS_ENABLEDEVELOPER is set.
Expand Down Expand Up @@ -275,6 +277,12 @@ bundle:
rm -rf dist/
mkdir -p dist/$(PLUGIN_ID)
./build/bin/manifest dist
ifneq ($(wildcard LICENSE.txt),)
cp -r LICENSE.txt dist/$(PLUGIN_ID)/
endif
ifneq ($(wildcard NOTICE.txt),)
cp -r NOTICE.txt dist/$(PLUGIN_ID)/
endif
ifneq ($(wildcard $(ASSETS_DIR)/.),)
cp -r $(ASSETS_DIR) dist/$(PLUGIN_ID)/
endif
Expand Down
3 changes: 3 additions & 0 deletions build/manifest/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package main

import (
Expand Down
3 changes: 3 additions & 0 deletions build/pluginctl/logs.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package main

import (
Expand Down
3 changes: 3 additions & 0 deletions build/pluginctl/logs_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package main

import (
Expand Down
3 changes: 3 additions & 0 deletions build/pluginctl/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

// main handles deployment of the plugin to a development server using the Client4 API.
package main

Expand Down
2 changes: 1 addition & 1 deletion calendar/api/api.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package api

Expand Down
3 changes: 3 additions & 0 deletions calendar/api/autocomplete.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package api

import (
Expand Down
3 changes: 3 additions & 0 deletions calendar/api/autocomplete_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package api

import (
Expand Down
3 changes: 3 additions & 0 deletions calendar/api/connected_user.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package api

import (
Expand Down
3 changes: 3 additions & 0 deletions calendar/api/connected_user_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package api

import (
Expand Down
3 changes: 3 additions & 0 deletions calendar/api/events.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package api

import (
Expand Down
3 changes: 3 additions & 0 deletions calendar/api/events_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package api

import (
Expand Down
2 changes: 1 addition & 1 deletion calendar/api/get_authorized.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package api

Expand Down
3 changes: 3 additions & 0 deletions calendar/api/notifcation_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package api

import (
Expand Down
2 changes: 1 addition & 1 deletion calendar/api/notification.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package api

Expand Down
2 changes: 1 addition & 1 deletion calendar/api/post_action.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package api

Expand Down
3 changes: 3 additions & 0 deletions calendar/api/post_action_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package api

import (
Expand Down
3 changes: 3 additions & 0 deletions calendar/api/test_utils.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package api

import (
Expand Down
2 changes: 1 addition & 1 deletion calendar/command/availability.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package command

Expand Down
2 changes: 1 addition & 1 deletion calendar/command/command.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package command

Expand Down
2 changes: 1 addition & 1 deletion calendar/command/connect.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package command

Expand Down
3 changes: 3 additions & 0 deletions calendar/command/connect_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package command

import (
Expand Down
3 changes: 3 additions & 0 deletions calendar/command/daily_summary.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package command

import (
Expand Down
3 changes: 3 additions & 0 deletions calendar/command/daily_summary_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package command

import (
Expand Down
2 changes: 1 addition & 1 deletion calendar/command/disconnect.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package command

Expand Down
3 changes: 3 additions & 0 deletions calendar/command/disconnect_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package command

import (
Expand Down
2 changes: 1 addition & 1 deletion calendar/command/event.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package command

Expand Down
3 changes: 3 additions & 0 deletions calendar/command/get_calendars.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package command

import (
Expand Down
2 changes: 1 addition & 1 deletion calendar/command/help.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package command

Expand Down
2 changes: 1 addition & 1 deletion calendar/command/info.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package command

Expand Down
2 changes: 1 addition & 1 deletion calendar/command/settings.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package command

Expand Down
2 changes: 1 addition & 1 deletion calendar/command/subscribe.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package command

Expand Down
2 changes: 1 addition & 1 deletion calendar/command/unsubscribe.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package command

Expand Down
2 changes: 1 addition & 1 deletion calendar/command/view_calendar.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package command

Expand Down
3 changes: 3 additions & 0 deletions calendar/config/config.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package config

import "github.com/mattermost/mattermost-plugin-mscalendar/calendar/utils/bot"
Expand Down
2 changes: 1 addition & 1 deletion calendar/config/const.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package config

Expand Down
2 changes: 1 addition & 1 deletion calendar/engine/availability.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package engine

Expand Down
2 changes: 1 addition & 1 deletion calendar/engine/availability_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package engine

Expand Down
2 changes: 1 addition & 1 deletion calendar/engine/calendar.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package engine

Expand Down
3 changes: 3 additions & 0 deletions calendar/engine/calendar_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package engine

import (
Expand Down
2 changes: 1 addition & 1 deletion calendar/engine/client.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package engine

Expand Down
4 changes: 2 additions & 2 deletions calendar/engine/daily_summary.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package engine

Expand Down
3 changes: 3 additions & 0 deletions calendar/engine/daily_summary_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package engine

import (
Expand Down
2 changes: 1 addition & 1 deletion calendar/engine/event_responder.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package engine

Expand Down
3 changes: 3 additions & 0 deletions calendar/engine/event_responder_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

package engine

import (
Expand Down
2 changes: 1 addition & 1 deletion calendar/engine/filters.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
// See LICENSE.txt for license information.

package engine

Expand Down
Loading

0 comments on commit 382bb17

Please sign in to comment.