Skip to content

Per-type skip #3312

Open
Open
@nilgoyette

Description

@nilgoyette

As discussed in #2924 and "hinted" in #2555 and maybe others, a per-type skip would be nice. I don't have tens of use-case, in fact I have only one: the matrix. In our computer graphic application, we define a lot of matrices in several modules, thus making #[rustfmt::skip] uninteresting. What I (and probably many others) want is something like

// in lib.rs or mod.rs. Or top of a file?
#[rustfmt::skip(Matrix3, Matrix4)]

because I can't imagine a single case where I would want rustfmt to format my matrices. The only right way to format a 3x3 matrix is when it has 3 columns and 3 rows. All in one line or in one row is unreadable.

I don't know rustfmt code at all, nor what it could possibly do. Do you have access to the base type when parsing the files? I ask because I wonder if an alias type Affine = Matrix3<f64> would force the user too add all aliases in the skip, if such a feature existed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions