Skip to content

Add yamllint pre-commit hook for YAML file standardization #11017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

vanzan01
Copy link

Add yamllint hook to .pre-commit-config.yaml to standardize YAML files across the project. Created .yamllint.yml configuration with relaxed rules to accommodate existing files. Fixed colon spacing in .asf.yaml to pass yamllint checks.

Changes

  • Add yamllint hook to .pre-commit-config.yaml
  • Create .yamllint.yml configuration with relaxed rules for existing files
  • Fix colon spacing in .asf.yaml to pass yamllint checks

Test plan

  • yamllint runs successfully on existing YAML files
  • Configuration allows existing files to pass with minimal changes
  • Fixed formatting issue in .asf.yaml

Closes #10974

Add yamllint hook to .pre-commit-config.yaml to standardize YAML files
across the project. Created .yamllint.yml configuration with relaxed
rules to accommodate existing files. Fixed colon spacing in .asf.yaml
to pass yamllint checks.

Closes apache#10974

Signed-off-by: vanzan01 <[email protected]>
Copy link

boring-cyborg bot commented Jun 12, 2025

Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
Here are some useful points:

Address review comment from DaanHoogland

Signed-off-by: vanzan01 <[email protected]>
@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

Copy link

codecov bot commented Jun 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 3.90%. Comparing base (2d669db) to head (7fb54b5).
Report is 14 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (2d669db) and HEAD (7fb54b5). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (2d669db) HEAD (7fb54b5)
unittests 1 0
Additional details and impacted files
@@              Coverage Diff              @@
##               main   #11017       +/-   ##
=============================================
- Coverage     16.60%    3.90%   -12.71%     
=============================================
  Files          5730      414     -5316     
  Lines        508082    33744   -474338     
  Branches      61770     6074    -55696     
=============================================
- Hits          84388     1317    -83071     
+ Misses       414259    32271   -381988     
+ Partials       9435      156     -9279     
Flag Coverage Δ
uitests 3.90% <ø> (-0.04%) ⬇️
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13778

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 13794

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13815

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clgtm

- Move .yamllint.yml to .github/linters/ directory for better organization
- Update pre-commit config to point to new location
- Change file pattern to \.ya?ml$ as suggested

Address review feedback from jbampton

Signed-off-by: vanzan01 <[email protected]>
Copy link
Member

@jbampton jbampton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- Remove extensive file exclusions, keep only k8s templates
- Increase line length limit to 400 chars (GitHub Actions friendly)
- Allow flexible colon spacing (max-spaces-after: -1)
- Disable document-start requirement

This provides linting value while handling infrastructure patterns.

Signed-off-by: vanzan01 <[email protected]>
@vanzan01 vanzan01 requested a review from jbampton June 21, 2025 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add pre-commit hook yamllint to standardize YAML files
4 participants