Update license year (#871)

* Update license header file spec to use placeholder year
* Update spotless to use ratchet formatting (only format files that have changed)
This commit is contained in:
Daniel Chao
2025-01-07 10:15:07 +00:00
committed by Daniel Chao
parent 6c8e45b19a
commit 56a3b0a193
5 changed files with 12 additions and 4 deletions
+4
View File
@@ -26,6 +26,10 @@ Enable _jenv_ plugins for better handling by `gradle`:
jenv enable-plugin gradle jenv enable-plugin gradle
jenv enable-plugin export jenv enable-plugin export
---- ----
. (optional) If you've named the original apple/pkl git repository something other than `origin`, set env var `PKL_ORIGINAL_REMOTE_NAME` to that name in your `.bashrc`, `.zshrc`, `config.fish` or however you manage your local environment.
+
This will allow spotless to pick the correct starting branch when formatting source code files.
Otherwise, you might see that _every_ file has its copyright year updated.
=== Additional Linux Setup === Additional Linux Setup
. (optional) To build the native executable (`./gradlew buildNative`), . (optional) To build the native executable (`./gradlew buildNative`),
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright © 2024 Apple Inc. and the Pkl project authors Copyright © 2024-2025 Apple Inc. and the Pkl project authors
Portions of this software were originally based on 'SnakeYAML' developed by Andrey Somov. Portions of this software were originally based on 'SnakeYAML' developed by Andrey Somov.
@@ -1,5 +1,5 @@
/* /*
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved. * Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@@ -132,7 +132,11 @@ private fun KotlinGradleExtension.configureFormatter() {
licenseHeaderFile(licenseHeaderFile, "([a-zA-Z]|@file|//)") licenseHeaderFile(licenseHeaderFile, "([a-zA-Z]|@file|//)")
} }
val originalRemoteName = System.getenv("PKL_ORIGINAL_REMOTE_NAME") ?: "origin"
spotless { spotless {
ratchetFrom = "$originalRemoteName/main"
// When building root project, format buildSrc files too. // When building root project, format buildSrc files too.
// We need this because buildSrc is not a subproject of the root project, so a top-level // We need this because buildSrc is not a subproject of the root project, so a top-level
// `spotlessApply` will not trigger `buildSrc:spotlessApply`. // `spotlessApply` will not trigger `buildSrc:spotlessApply`.
@@ -1,5 +1,5 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved. // Copyright © $YEAR Apple Inc. and the Pkl project authors. All rights reserved.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/* /*
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved. * Copyright © $YEAR Apple Inc. and the Pkl project authors. All rights reserved.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.