Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 21 additions & 0 deletions scripts/__tests__/yaml/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
})
1 change: 1 addition & 0 deletions scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion scripts/src/yaml/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ export class Config {
toString(): string {
return this._document.toString({
collectionStyle: 'block',
singleQuote: false
singleQuote: false,
lineWidth: 0
})
}

Expand Down