Fix YAML linting errors in .mergify.yml and .yamllintignore files
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 71
Description
# CloudSmith Troubleshooting Summary
## Trigger details
| Workflow run | Branch | Commit |
|---|---|---|
| [#15889193009](https://github.com/aws/aws-cdk/actions/runs/15889193009) | ```main``` | ```d348bc281c58ea382c42dfcfa609f13ce4f171da``` |
----
## Detailed Findings
### Issue 1
**Problem**: The workflow is failing because the .mergify.yml file contains lines that exceed the maximum line length of 120 characters set in the .yamllint.yml configuration. The yamllint tool is reporting multiple line length violations in this file.
**File**: ```.mergify.yml```
**Error Log**:
```
2025-06-25T23:20:51.0280830Z ##[error]73:121 [line-length] line too long (343 > 120 characters)\n2025-06-25T23:20:51.0289096Z ##[error]93:121 [line-length] line too long (343 > 120 characters)\n2025-06-25T23:20:51.0290327Z ##[error]114:121 [line-length] line too long (328 > 120 characters)\n2025-06-25T23:20:51.0291748Z ##[error]135:121 [line-length] line too long (346 > 120 characters)\n2025-06-25T23:20:51.0292922Z ##[error]169:121 [line-length] line too long (151 > 120 characters)
```
**Code snippet**:
```
- status-success~=AWS CodeBuild us-east-1\n - status-success=validate-pr\n commit_message_template: |-\n {{ title }} (#{{ number }})\n {{ body }}
```
**Solution Plan**:
1. Edit the .mergify.yml file to fix the lines that exceed 120 characters by breaking them into multiple lines.
2. For each of the long lines (at lines 73, 93, 114, 135, and 169), split the content to ensure no line exceeds 120 characters.
3. For example, for the comment messages that are too long, break them into multiple lines using YAML's multi-line string syntax.
4. Here's an example of how to fix one of the long lines: Original: Fixed:
```yaml
message: Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to [allow changes to be pushed to your fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork)).
```
```yaml
message: >-
Thank you for contributing! Your pull request will be updated from main and then merged automatically
(do not update manually, and be sure to
[allow changes to be pushed to your fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork)).
```
5. Apply similar fixes to all other lines that exceed 120 characters.
6. Run `yarn lint:yaml` locally to verify the changes before committing.
----
### Issue 2
**Problem**: The .yamllintignore file is missing a newline character at the end of the file, which is causing a linting error.
**File**: ```.yamllintignore```
**Error Log**:
```
2025-06-25T23:20:51.3009886Z ##[error]5:17 [new-line-at-end-of-file] no new line character at the end of file
```
**Code snippet**:
```
# Ignore specific problematic files\ncodecov.yml
```
**Solution Plan**:
1. Edit the .yamllintignore file.
2. Add a newline character at the end of the file after "codecov.yml".
3. The corrected file should look like: (with a newline after "codecov.yml")
```
# Ignore specific problematic files
codecov.yml
```
4. Save the file and commit the changes.
5. Run `yarn lint:yaml` locally to verify the fix before pushing.
----
Contributor guide
Research direction
Inspect .mergify.yml at the reported lines 73, 93, 114, 135, and 169, then check .yamllintignore for its final newline. Run `yarn lint:yaml`; the work is done when both files pass the configured YAML lint checks without line-length or end-of-file errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- yaml
- Domain
- ci-cd
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100