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 GitHub
parent 467e64f98e
commit f6c74e90a8
5 changed files with 12 additions and 4 deletions

View File

@@ -24,6 +24,10 @@ Enable _jenv_ plugins for better handling by `gradle`:
jenv enable-plugin gradle
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 Windows Setup
. (optional) Go to `System->For developers` and enable `Developer Mode`.

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.

View File

@@ -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");
* 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|//)")
}
val originalRemoteName = System.getenv("PKL_ORIGINAL_REMOTE_NAME") ?: "origin"
spotless {
ratchetFrom = "$originalRemoteName/main"
// 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
// `spotlessApply` will not trigger `buildSrc:spotlessApply`.

View File

@@ -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");
// you may not use this file except in compliance with the License.

View File

@@ -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");
* you may not use this file except in compliance with the License.