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

Feature Request: Allow Ignoring Specific Lines or Blocks in Formatting #655

Open
leinardi opened this issue Mar 3, 2025 · 0 comments
Open

Comments

@leinardi
Copy link
Contributor

leinardi commented Mar 3, 2025

Description

It would be helpful if rain fmt supported a way to ignore specific lines or blocks in a CloudFormation template. This is useful when formatting needs to be skipped for certain parts of the file due to external constraints (e.g., manually controlled formatting).

Proposed Solutions

Many linters support this through inline comments. For example:

  • Ignoring a single line:

    Resources:
      MyBucket:
        Type: AWS::S3::Bucket  # rain disable-line
  • Ignoring a block:

    # rain disable
    Resources:
      MyBucket:
        Type: AWS::S3::Bucket
        Properties:
          BucketName: MyCustomBucket
    # rain enable
  • Ignoring an entire file:

    # rain disable-file

This behavior is similar to tools like yamllint, which use structured comments to temporarily disable specific checks.

Benefit

  • Enables finer control over formatting.
  • Helps preserve intentional formatting decisions.
  • Avoids the need for workarounds like separating specific parts into external files.
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

No branches or pull requests

1 participant