renovate 43.36.0 → 43.36.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,8 +2,21 @@ import { hiddenUnicodeCharactersRegex, toUnicodeEscape } from "./regex.js";
2
2
  import { logger } from "../logger/index.js";
3
3
 
4
4
  //#region lib/util/unicode.ts
5
+ function isBinaryContent(content) {
6
+ const sampleSize = Math.min(content.length, 8192);
7
+ for (let i = 0; i < sampleSize; i++) if (content[i] === 0) return true;
8
+ return false;
9
+ }
5
10
  function logWarningIfUnicodeHiddenCharactersInPackageFile(file, content) {
6
- const hiddenCharacters = content.toString("utf8").match(hiddenUnicodeCharactersRegex);
11
+ const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content);
12
+ const hiddenCharacters = buffer.toString("utf8").match(hiddenUnicodeCharactersRegex);
13
+ if (isBinaryContent(buffer) && hiddenCharacters) {
14
+ logger.trace({
15
+ file,
16
+ hiddenCharacters: toUnicodeEscape(hiddenCharacters.join(""))
17
+ }, `Hidden Unicode characters discovered in file \`${file}\`, but not logging higher than TRACE as it appears to be a binary file`);
18
+ return;
19
+ }
7
20
  if (hiddenCharacters) if (hiddenCharacters.length === 1 && hiddenCharacters[0] === "") logger.once.trace({
8
21
  file,
9
22
  hiddenCharacters: toUnicodeEscape(hiddenCharacters.join(""))
@@ -1 +1 @@
1
- {"version":3,"file":"unicode.js","names":[],"sources":["../../lib/util/unicode.ts"],"sourcesContent":["import { logger } from '../logger/index.ts';\nimport { hiddenUnicodeCharactersRegex, toUnicodeEscape } from './regex.ts';\n\nexport function logWarningIfUnicodeHiddenCharactersInPackageFile(\n file: string,\n content: string | Buffer,\n): void {\n const hiddenCharacters = content\n .toString('utf8')\n .match(hiddenUnicodeCharactersRegex);\n if (hiddenCharacters) {\n if (hiddenCharacters.length === 1 && hiddenCharacters[0] === '\\uFEFF') {\n logger.once.trace(\n {\n file,\n hiddenCharacters: toUnicodeEscape(hiddenCharacters.join('')),\n },\n `Hidden Byte Order Mark (BOM) Unicode characters has been discovered in the file \\`${file}\\`. This is likely safe, if you are using Microsoft Windows, but please confirm that they are intended to be there, as they could be an attempt to \"smuggle\" text into your codebase, or used to confuse tools like Renovate or Large Language Models (LLMs)`,\n );\n } else {\n logger.once.warn(\n {\n file,\n hiddenCharacters: toUnicodeEscape(hiddenCharacters.join('')),\n },\n `Hidden Unicode characters have been discovered in file(s) in your repository. See your Renovate logs for more details. Please confirm that they are intended to be there, as they could be an attempt to \"smuggle\" text into your codebase, or used to confuse tools like Renovate or Large Language Models (LLMs)`,\n );\n }\n }\n}\n"],"mappings":";;;;AAGA,SAAgB,iDACd,MACA,SACM;CACN,MAAM,mBAAmB,QACtB,SAAS,OAAO,CAChB,MAAM,6BAA6B;AACtC,KAAI,iBACF,KAAI,iBAAiB,WAAW,KAAK,iBAAiB,OAAO,IAC3D,QAAO,KAAK,MACV;EACE;EACA,kBAAkB,gBAAgB,iBAAiB,KAAK,GAAG,CAAC;EAC7D,EACD,qFAAqF,KAAK,8PAC3F;KAED,QAAO,KAAK,KACV;EACE;EACA,kBAAkB,gBAAgB,iBAAiB,KAAK,GAAG,CAAC;EAC7D,EACD,qTACD"}
1
+ {"version":3,"file":"unicode.js","names":[],"sources":["../../lib/util/unicode.ts"],"sourcesContent":["import { logger } from '../logger/index.ts';\nimport { hiddenUnicodeCharactersRegex, toUnicodeEscape } from './regex.ts';\n\nfunction isBinaryContent(content: Buffer): boolean {\n // Check for null bytes in the first 8KB - a common indicator of binary content\n const sampleSize = Math.min(content.length, 8192);\n for (let i = 0; i < sampleSize; i++) {\n if (content[i] === 0) {\n return true;\n }\n }\n return false;\n}\n\nexport function logWarningIfUnicodeHiddenCharactersInPackageFile(\n file: string,\n content: string | Buffer,\n): void {\n const buffer = Buffer.isBuffer(content) ? content : Buffer.from(content);\n const hiddenCharacters = buffer\n .toString('utf8')\n .match(hiddenUnicodeCharactersRegex);\n\n if (isBinaryContent(buffer) && hiddenCharacters) {\n logger.trace(\n {\n file,\n hiddenCharacters: toUnicodeEscape(hiddenCharacters.join('')),\n },\n\n `Hidden Unicode characters discovered in file \\`${file}\\`, but not logging higher than TRACE as it appears to be a binary file`,\n );\n return;\n }\n\n if (hiddenCharacters) {\n if (hiddenCharacters.length === 1 && hiddenCharacters[0] === '\\uFEFF') {\n logger.once.trace(\n {\n file,\n hiddenCharacters: toUnicodeEscape(hiddenCharacters.join('')),\n },\n `Hidden Byte Order Mark (BOM) Unicode characters has been discovered in the file \\`${file}\\`. This is likely safe, if you are using Microsoft Windows, but please confirm that they are intended to be there, as they could be an attempt to \"smuggle\" text into your codebase, or used to confuse tools like Renovate or Large Language Models (LLMs)`,\n );\n } else {\n logger.once.warn(\n {\n file,\n hiddenCharacters: toUnicodeEscape(hiddenCharacters.join('')),\n },\n `Hidden Unicode characters have been discovered in file(s) in your repository. See your Renovate logs for more details. Please confirm that they are intended to be there, as they could be an attempt to \"smuggle\" text into your codebase, or used to confuse tools like Renovate or Large Language Models (LLMs)`,\n );\n }\n }\n}\n"],"mappings":";;;;AAGA,SAAS,gBAAgB,SAA0B;CAEjD,MAAM,aAAa,KAAK,IAAI,QAAQ,QAAQ,KAAK;AACjD,MAAK,IAAI,IAAI,GAAG,IAAI,YAAY,IAC9B,KAAI,QAAQ,OAAO,EACjB,QAAO;AAGX,QAAO;;AAGT,SAAgB,iDACd,MACA,SACM;CACN,MAAM,SAAS,OAAO,SAAS,QAAQ,GAAG,UAAU,OAAO,KAAK,QAAQ;CACxE,MAAM,mBAAmB,OACtB,SAAS,OAAO,CAChB,MAAM,6BAA6B;AAEtC,KAAI,gBAAgB,OAAO,IAAI,kBAAkB;AAC/C,SAAO,MACL;GACE;GACA,kBAAkB,gBAAgB,iBAAiB,KAAK,GAAG,CAAC;GAC7D,EAED,kDAAkD,KAAK,yEACxD;AACD;;AAGF,KAAI,iBACF,KAAI,iBAAiB,WAAW,KAAK,iBAAiB,OAAO,IAC3D,QAAO,KAAK,MACV;EACE;EACA,kBAAkB,gBAAgB,iBAAiB,KAAK,GAAG,CAAC;EAC7D,EACD,qFAAqF,KAAK,8PAC3F;KAED,QAAO,KAAK,KACV;EACE;EACA,kBAAkB,gBAAgB,iBAAiB,KAAK,GAAG,CAAC;EAC7D,EACD,qTACD"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "renovate",
3
3
  "description": "Automated dependency updates. Flexible so you don't need to be.",
4
- "version": "43.36.0",
4
+ "version": "43.36.1",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "renovate": "dist/renovate.js",
@@ -1,7 +1,7 @@
1
1
  {
2
- "title": "JSON schema for Renovate 43.36.0 config files (https://renovatebot.com/)",
2
+ "title": "JSON schema for Renovate 43.36.1 config files (https://renovatebot.com/)",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
- "x-renovate-version": "43.36.0",
4
+ "x-renovate-version": "43.36.1",
5
5
  "allowComments": true,
6
6
  "type": "object",
7
7
  "properties": {