This is an automated email from the ASF dual-hosted git repository.
sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git
The following commit(s) were added to refs/heads/main by this push:
new 3220d76 Exclude generated files from lightweight checks in addition
to RAT checks
3220d76 is described below
commit 3220d7615bf71d14c7ab0ec1b29469adf173e522
Author: Sean B. Palmer <[email protected]>
AuthorDate: Thu Jan 8 15:18:46 2026 +0000
Exclude generated files from lightweight checks in addition to RAT checks
---
atr/constants.py | 10 ++++++++++
atr/tasks/checks/license.py | 5 ++++-
atr/tasks/checks/rat.py | 11 ++---------
3 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/atr/constants.py b/atr/constants.py
index 6d8b32b..84f2972 100644
--- a/atr/constants.py
+++ b/atr/constants.py
@@ -221,3 +221,13 @@ APACHE_LICENSE_2_0: Final[str] = """\
See the License for the specific language governing permissions and
limitations under the License.
"""
+
+GENERATED_FILE_SUFFIXES: Final[tuple[str, ...]] = (
+ ".bundle.js",
+ ".chunk.js",
+ ".css.map",
+ ".js.map",
+ ".min.css",
+ ".min.js",
+ ".min.map",
+)
diff --git a/atr/tasks/checks/license.py b/atr/tasks/checks/license.py
index 12f28b1..e91df0e 100644
--- a/atr/tasks/checks/license.py
+++ b/atr/tasks/checks/license.py
@@ -526,7 +526,10 @@ def _headers_check_core_logic_process_file(
def _headers_check_core_logic_should_check(filepath: str) -> bool:
- """Determine if a file should be checked for license headers."""
+ """Determine whether a file should be checked for license headers."""
+ if filepath.endswith(constants.GENERATED_FILE_SUFFIXES):
+ return False
+
ext = _get_file_extension(filepath)
if ext is None:
return False
diff --git a/atr/tasks/checks/rat.py b/atr/tasks/checks/rat.py
index 0ca3d04..6988367 100644
--- a/atr/tasks/checks/rat.py
+++ b/atr/tasks/checks/rat.py
@@ -25,6 +25,7 @@ from typing import Any, Final
import atr.archives as archives
import atr.config as config
+import atr.constants as constants
import atr.log as log
import atr.models.results as results
import atr.models.sql as sql
@@ -44,15 +45,7 @@ _JAVA_MEMORY_ARGS: Final[list[str]] = []
# ]
# Generated file patterns, always excluded
-_GENERATED_FILE_PATTERNS: Final[list[str]] = [
- "**/*.bundle.js",
- "**/*.chunk.js",
- "**/*.css.map",
- "**/*.js.map",
- "**/*.min.css",
- "**/*.min.js",
- "**/*.min.map",
-]
+_GENERATED_FILE_PATTERNS: Final[list[str]] = [f"**/*{s}" for s in
constants.GENERATED_FILE_SUFFIXES]
# The name of the file that contains the exclusions for the specified archive
_RAT_EXCLUDES_FILENAME: Final[str] = ".rat-excludes"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]