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

allow usage of --header-opt-in and --header-opt-out flags #3

Open
alexdean opened this issue Feb 15, 2023 · 0 comments · May be fixed by #4
Open

allow usage of --header-opt-in and --header-opt-out flags #3

alexdean opened this issue Feb 15, 2023 · 0 comments · May be fixed by #4

Comments

@alexdean
Copy link

rubyfmt supports two flags which are useful when introducing the tool to an existing codebase.

  • rubyfmt --header-opt-in -- files or directories to format files only with a # rubyfmt: true comment at the top of the file
  • rubyfmt --header-opt-out -- files or directories to skip formatting files with a # rubyfmt: false comment at the top of the file

https://github.com/fables-tales/rubyfmt#build-from-source

It would be very useful to be able to use these options via the sublime package. Currently this isn't possible because the "rubyfmt_executable" package setting expects to be only the binary, & does not allow flags.

when i use this config

{
  "rubyfmt_executable": "rubyfmt --header-opt-in",
  "format_on_save": true,
}

i see this error in the sublime console when saving a ruby file:

FileNotFoundError: [Errno 2] No such file or directory: 'rubyfmt --header-opt-in'
alexdean added a commit to alexdean/sublime-rubyfmt that referenced this issue Feb 15, 2023
fixes toreriklinnerud#3

example config:

  {
    "rubyfmt_executable": "rubyfmt",
    "format_on_save": true,
    "rubyfmt_flags": "--header-opt-in"
  }
@alexdean alexdean linked a pull request Feb 15, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant