Skip to content

Conversation

@trentm
Copy link
Contributor

@trentm trentm commented Aug 1, 2025

Fixes: #2967
Refs: nikku/eslint-plugin-license-header#26

checklist

This is still in draft because it is incomplete. The current license-header eslint plugin won't suffice until nikku/eslint-plugin-license-header#26 or similar functionality is added to it. This is because the license header for this repo allows for some variance. Currently license-header required a single version.

  • get the license-header PR in (hopefully), and a new release
  • update to that release of license-header
  • Customize the pattern for instr-oracledb which has another variance. We could technically allow that variance in the top-level regex so a separate custom regex isn't required.
  • discuss whether the strict newline separation enforced by license-header is acceptable
{
"allowedHeaderPatterns": [
// Allow additional copyrights on the first line.
/^\/\*\r?\n \* Copyright The OpenTelemetry Authors(, .+)*\r?\n \*\r?\n \* Licensed under the Apache License, Version 2.0 \(the "License"\);\r?\n \* you may not use this file except in compliance with the License.\r?\n \* You may obtain a copy of the License at\r?\n \*\r?\n \* https:\/\/www.apache.org\/licenses\/LICENSE-2.0\r?\n \*\r?\n \* Unless required by applicable law or agreed to in writing, software\r?\n \* distributed under the License is distributed on an "AS IS" BASIS,\r?\n \* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r?\n \* See the License for the specific language governing permissions and\r?\n \* limitations under the License.\r?\n \*\/$/,

Check failure

Code scanning / CodeQL

Inefficient regular expression High

This part of the regular expression may cause exponential backtracking on strings starting with '/*\n * Copyright The OpenTelemetry Authors, ' and containing many repetitions of 'a, '.
@codecov
Copy link

codecov bot commented Aug 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.84%. Comparing base (9d90781) to head (fd1705f).
⚠️ Report is 167 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@ ## main #2969 +/- ## ========================================== + Coverage 89.79% 89.84% +0.04%  ========================================== Files 188 188 Lines 9222 9272 +50 Branches 1900 1901 +1 ========================================== + Hits 8281 8330 +49  - Misses 941 942 +1 
Files with missing lines Coverage Δ
packages/instrumentation-kafkajs/src/propagator.ts 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
trentm added a commit to trentm/opentelemetry-js-contrib that referenced this pull request Sep 12, 2025
…cense headers This changes to a new eslint-plugin to handle license headers. It supports the configurability that we need to allow additional Copyright holders. I've manually adapted the Copyright positioning in instr-oracledb and resource-detector-gcp to conform with the defined license header pattern. We can adjust the regexp if we need. Refs: open-telemetry#2969
@trentm
Copy link
Contributor Author

trentm commented Oct 15, 2025

Obsoleted by the work in #3001 -- we are now using https://github.com/trentm/eslint-plugin-yet-another-license-header, which is effectively the license-header eslint plugin functionality with the added fix that I was trying to upstream.

@trentm trentm closed this Oct 15, 2025
@trentm trentm deleted the trentm-better-eslint-license-header-plugin branch October 15, 2025 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment