Skip to content
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

chore(ci): integrate yamllint and alejandra linters #455

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jbcaron
Copy link
Member

@jbcaron jbcaron commented Jan 7, 2025

Pull Request type

Please add the labels corresponding to the type of changes your PR introduces:

  • Code style update (formatting, renaming)
  • Build-related changes

What is the current behavior?

Currently, YAML files are only validated through Prettier, which primarily focuses on basic formatting. This limited approach may miss YAML-specific syntax issues and doesn't enforce consistent YAML style guidelines. Additionally, there is no dedicated linting for Nix files in the repository.

Resolves: #NA

What is the new behavior?

  • Add yamllint to validate YAML files syntax and formatting
  • Add Alejandra to enforce consistent Nix files formatting
  • Include configuration files (.yamllint.yml)
  • Integrate both linters into the existing CI pipeline
  • Keep existing Prettier configuration and checks in place

Does this introduce a breaking change?

No

Other information

This PR is part of our ongoing effort to improve code quality and consistency across the codebase. The linting rules have been configured to be strict enough to catch common issues while remaining flexible enough to not impede development workflow.

To test locally:

# For YAML files
pip install yamllint
yamllint -c .yamllint.yml .

# For Nix files
nix-shell -p alejandra
alejandra --check .

@jbcaron jbcaron added the infrastructure CI/CD, deployment and infrastructure changes label Jan 7, 2025
@jbcaron jbcaron requested review from antiyro and Trantorian1 January 7, 2025 14:52
@jbcaron jbcaron self-assigned this Jan 7, 2025
@jbcaron jbcaron force-pushed the ci/linters branch 3 times, most recently from ee32952 to d107522 Compare January 7, 2025 15:50
@jbcaron jbcaron changed the title ci: integrate yamllint and alejandra linters chore(ci): integrate yamllint and alejandra linters Jan 7, 2025
Copy link
Collaborator

@Trantorian1 Trantorian1 left a comment

Choose a reason for hiding this comment

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

Perhaps it is worth updating scripts/madara as it has a lint command which lints the project.

@@ -1,87 +1,84 @@
---
- name: "breaking-change"
- name: breaking-change
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we enforce some kind of spacing between sections for his kind of file?

Copy link
Contributor

@Mohiiit Mohiiit left a comment

Choose a reason for hiding this comment

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

maybe we can keep empty lines in yaml? wdyt?

- uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest keeping line breaks between YAML sections as it follows standard formatting practices and improves readability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure CI/CD, deployment and infrastructure changes
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

3 participants