Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Curst Formatter Action

A GitHub Action that applies curst (cursed + rust) formatting to Rust code by aligning all braces ({, }) and semicolons (;) in a right-aligned column. Perfect for wasting some time on a slow work day.

What it does

Transforms this Rust code:

fn main() {
    let x = 42;
    if x > 0 {
        println!("positive");
    }
}

Into this masterpiece:

fn main()                    {
    let x = 42               ;
    if x > 0                 {
        println!("positive") ;
                             }                        
                             }

Usage

Basic Usage (Recommended)

name: Curst Formatter

on:
  push:
    branches: [ main ]
    paths: [ '**/*.rs' ]

jobs:
  format:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    
    steps:
      - uses: actions/checkout@v4
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
      
      - uses: gacorp/curst-formatter@v1

Advanced Usage with Custom Options

- uses: gacorp/curst-formatter@v1
  with:
    token: ${{ secrets.GITHUB_TOKEN }}
    commit-message: "take up even more space"
    spacing: 3

Inputs

Input Description Required Default
token GitHub token for committing changes No ${{ github.token }}
commit-message Commit message for formatted files No apply curst formatting
spacing Spaces between longest line and aligned braces No 2

Requirements

  • Permissions: The action needs contents: write permission to commit changes
  • Rust files: Only processes .rs files in the repository

Example Workflows

Look into the examples/example-workflow.yml file.

Why Would You Do This?

  • Because you can

Contributing

Please open an issue or submit a pull request for any bugs or feature requests.

License

MIT License (c) 2025 Raj Singh

Disclaimer

⚠️ This action will modify your Rust source files and commit changes automatically. Use with caution on important projects! Consider testing on a fork first.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors