You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is more a feature request since I imagine other tools (e.g. VSCode extensions will need it, see the discussion in #354) will need it: currently, any tool formatting through stdin loses all ability to use .rubyfmtignore, but there are plenty of cases where reading from disk isn't convenient/possible, especially in VSCode extensions like the Ruby and Sorbet extensions.
Having something like --stdin-path from prettier would simplify this problem by basically telling rubyfmt to format file contents as if they were at the given path, and ignore them as needed. This prevents extensions from having to manually handle .rubyfmtignore paths.
So for example, if my .rubyfmtignore has foo.rb in it, doing
Hmm, so there's a bit of a snag on this, which is mainly that BurntSushi/ripgrep#829 is still kicking around, which affects exact use-case. We're also not the first Rust-based code formatter (see JohnnyMorganz/StyLua#377) to get bitten by this, so I think this will likely turn out to be non-trivial (i.e. it may require hand-rolling out ignore logic, which sounds not-fun).
Gonna put this on the backburner for a bit, but it's worth noting that this also means that some pretty basic ignore patterns are gonna be busted for users, so this makes the .rubyfmtignore and .gitignore checking a bit less useful.
This is more a feature request since I imagine other tools (e.g. VSCode extensions will need it, see the discussion in #354) will need it: currently, any tool formatting through stdin loses all ability to use
.rubyfmtignore
, but there are plenty of cases where reading from disk isn't convenient/possible, especially in VSCode extensions like the Ruby and Sorbet extensions.Having something like
--stdin-path
fromprettier
would simplify this problem by basically telling rubyfmt to format file contents as if they were at the given path, and ignore them as needed. This prevents extensions from having to manually handle.rubyfmtignore
paths.So for example, if my
.rubyfmtignore
hasfoo.rb
in it, doingproduces no changes due to the file being ignored, but
produces changes as expected.
The text was updated successfully, but these errors were encountered: