From ffbce58e04fa50f89bf5719d0787b9ec47de976a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Thu, 22 Aug 2024 17:22:24 +0200 Subject: [PATCH] Add license header --- Makefile | 24 ++++++++++++++++++++++++ src/api_clients.rs | 14 ++++++++++++++ src/changes.rs | 14 ++++++++++++++ src/helm_config.rs | 14 ++++++++++++++ src/main.rs | 14 ++++++++++++++ src/remote.rs | 14 ++++++++++++++ src/repo.rs | 14 ++++++++++++++ 7 files changed, 108 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a12940f --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +MAKEFLAGS=--warn-undefined-variables +# /bin/sh is dash on Debian which does not support all features of ash/bash +# to fix that we use /bin/bash only on Debian to not break Alpine +ifneq (,$(wildcard /etc/os-release)) # check file existence + ifneq ($(shell grep -c debian /etc/os-release),0) + SHELL := /bin/bash + endif +endif + +prepare-static-check: FORCE + @if ! hash addlicense 2>/dev/null; then printf "\e[1;36m>> Installing addlicense...\e[0m\n"; go install github.com/google/addlicense@latest; fi + +license-headers: FORCE prepare-static-check + @printf "\e[1;36m>> addlicense\e[0m\n" + @addlicense -c "SAP SE" -- $(shell find -name *.rs) + +check-license-headers: FORCE prepare-static-check + @printf "\e[1;36m>> addlicense --check\e[0m\n" + @addlicense --check -- $(shell find -name *.rs) + +clean: FORCE + git clean -dxf build + +.PHONY: FORCE diff --git a/src/api_clients.rs b/src/api_clients.rs index 008e6c0..39c147d 100644 --- a/src/api_clients.rs +++ b/src/api_clients.rs @@ -1,3 +1,17 @@ +// Copyright 2024 SAP SE +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use std::env; use std::sync::Arc; diff --git a/src/changes.rs b/src/changes.rs index 7796d42..21c3360 100644 --- a/src/changes.rs +++ b/src/changes.rs @@ -1,3 +1,17 @@ +// Copyright 2024 SAP SE +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use anyhow::{anyhow, Context}; use octocrab::models::commits::Commit; use octocrab::models::pulls::Review; diff --git a/src/helm_config.rs b/src/helm_config.rs index a9ba3ab..20ecebb 100644 --- a/src/helm_config.rs +++ b/src/helm_config.rs @@ -1,3 +1,17 @@ +// Copyright 2024 SAP SE +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::collections::HashMap; use anyhow::Context; diff --git a/src/main.rs b/src/main.rs index 3e324f2..ee974d9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,17 @@ +// Copyright 2024 SAP SE +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + #![warn(clippy::pedantic)] mod api_clients; diff --git a/src/remote.rs b/src/remote.rs index 8de372a..21e8e1f 100644 --- a/src/remote.rs +++ b/src/remote.rs @@ -1,3 +1,17 @@ +// Copyright 2024 SAP SE +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use std::sync::Arc; use anyhow::{anyhow, Context}; diff --git a/src/repo.rs b/src/repo.rs index 6830eca..fa20807 100644 --- a/src/repo.rs +++ b/src/repo.rs @@ -1,3 +1,17 @@ +// Copyright 2024 SAP SE +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + use anyhow::Context; use git2::{Repository, Tree};