File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ spotless:
3030 stage : check
3131 script : ./gradlew spotlessCheck
3232
33+ licenseCheck :
34+ stage : check
35+ script :
36+ - ./license_checker.sh '*.java' | tee license_check_output.txt
37+ - ' [ ! -s license_check_output.txt ]'
38+
3339# stage: build ----------------------
3440
3541build :
Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
55and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
66
7+ ## [ Unreleased]
8+ ### Added
9+ * Script to check our source code for license headers and a step for them in the CI.
10+
711## [ 1.1.0] - 2023-01-26
812### Added
913* Add example maven project using this library.
@@ -71,6 +75,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7175Initial version.
7276
7377
78+ [ Unreleased ] : https://github.com/DeepLcom/deepl-java/compare/v1.1.0...HEAD
7479[ 1.1.0 ] : https://github.com/DeepLcom/deepl-java/compare/v1.0.1...v1.1.0
7580[ 1.0.1 ] : https://github.com/DeepLcom/deepl-java/compare/v1.0.0...v1.0.1
7681[ 1.0.0 ] : https://github.com/DeepLcom/deepl-java/compare/v0.2.1...v1.0.0
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # Usage: ./license_checker.sh source_code_pattern
4+ # Example: ./license_checker.sh '*.py'
5+ # This will search all .py files, ignoring anything not tracked in your git tree
6+
7+ git ls-files -z $1 | xargs -0 -I{} sh -c ' RES=$(head -n 3 "{}" | grep "Copyright 20[0-9][0-9] DeepL SE (https://www.deepl.com)"); if [ ! "${RES}" ] ; then echo "Lacking copyright header in" "{}" ; fi'
You can’t perform that action at this time.
0 commit comments