From 58cdfdf97975dbdd12272e12fc387bff44555aa3 Mon Sep 17 00:00:00 2001 From: galargh Date: Sun, 20 Apr 2025 20:20:10 +0000 Subject: [PATCH 1/2] upgrade@14562992463 --- .github/dependabot.yml | 10 ++++++++++ CHANGELOG.md | 1 + scripts/__tests__/yaml/config.test.ts | 21 +++++++++++++++++++++ scripts/package.json | 1 + scripts/src/yaml/config.ts | 3 ++- 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..624d0f6 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + - package-ecosystem: "npm" + directory: "/scripts/" + schedule: + interval: "weekly" diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e11723..65d9032 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - updated upload and download artifacts actions to v4 ### Fixed +- do not break long file content lines - source TF_WORKING_DIR from env helper instead of process.env in locals helper - fixed how terraform state is accessed before it the initial synchronization - links to supported resources in HOWTOs diff --git a/scripts/__tests__/yaml/config.test.ts b/scripts/__tests__/yaml/config.test.ts index 2f01d1b..cdd0bf8 100644 --- a/scripts/__tests__/yaml/config.test.ts +++ b/scripts/__tests__/yaml/config.test.ts @@ -477,4 +477,25 @@ repositories: assert.equal(previouslyUnarchivedRepository.archived, true) assert.equal(previouslyUnarchivedRepository.visibility, undefined) }) + + it("doesn't break long lines on format or toString", async () => { + const lines = [ + '# This is a very long comment that should NOT be broken down - this is a very long comment that should NOT be broken down - this is a very long comment that should NOT be broken down', + 'repositories:', + ' test:', + ' files:', + ' test:', + ' content: >', + ' This is a very long content that should NOT be broken down - this is a very long content that should NOT be broken down - this is a very long content that should NOT be broken down', + '' + ] + const source = lines.join('\n') + const config = new Config(source) + + assert.equal(config.toString(), source) + + config.format() + + assert.equal(config.toString(), source) + }) }) diff --git a/scripts/package.json b/scripts/package.json index 961b336..163245d 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -11,6 +11,7 @@ "lint": "eslint \"src/**/*.ts\" \"__tests__/**/*.ts\"", "lint:fix": "eslint --fix \"src/**/*.ts\" \"__tests__/**/*.ts\"", "test": "TF_EXEC=false TF_LOCK=false TF_WORKING_DIR=__tests__/__resources__/terraform GITHUB_DIR=__tests__/__resources__/github FILES_DIR=__tests__/__resources__/files GITHUB_ORG=default node --import tsx/esm --test --experimental-test-module-mocks \"__tests__/**/*.test.ts\"", + "test:only": "TF_EXEC=false TF_LOCK=false TF_WORKING_DIR=__tests__/__resources__/terraform GITHUB_DIR=__tests__/__resources__/github FILES_DIR=__tests__/__resources__/files GITHUB_ORG=default node --import tsx/esm --test --test-only --experimental-test-module-mocks \"__tests__/**/*.test.ts\"", "all": "npm run build && npm run format && npm run lint && npm test", "schema": "ts-json-schema-generator --tsconfig tsconfig.json --path src/yaml/schema.ts --type ConfigSchema --out ../github/.schema.json", "main": "node lib/main.js" diff --git a/scripts/src/yaml/config.ts b/scripts/src/yaml/config.ts index 07d1617..d43bfd3 100644 --- a/scripts/src/yaml/config.ts +++ b/scripts/src/yaml/config.ts @@ -86,7 +86,8 @@ export class Config { toString(): string { return this._document.toString({ collectionStyle: 'block', - singleQuote: false + singleQuote: false, + lineWidth: 0 }) } From b85bba2c598667c1f2cf195c67e797251e29e9d0 Mon Sep 17 00:00:00 2001 From: Piotr Galar Date: Sun, 20 Apr 2025 22:21:55 +0200 Subject: [PATCH 2/2] Delete .github/dependabot.yml --- .github/dependabot.yml | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 624d0f6..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: 2 -updates: - - package-ecosystem: "github-actions" # See documentation for possible values - directory: "/" # Location of package manifests - schedule: - interval: "weekly" - - package-ecosystem: "npm" - directory: "/scripts/" - schedule: - interval: "weekly"