obsproject / obs-plugintemplate

GNU General Public License v2.0
285 stars 133 forks source link

Default formatter scripts don't work when run from source directory #121

Closed micsthepick closed 4 months ago

micsthepick commented 4 months ago

Operating System Info

Ubuntu 22.04

Other OS

No response

OBS Studio Version

30.1.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

N/A

OBS Studio Crash Log URL

No response

Expected Behavior

runs from the CWD or runs from src dir automatically

Current Behavior

expects to run from project_root (up a level from src)

Steps to Reproduce

  1. clone this repo
  2. change formatting of a c/c++ module
  3. cd src
  4. ../build-aux/run-clang-format ...

Anything else we should know?

I'm using the template to include a sub-project, and I can imagine a use case where someone includes a sub-repository not working well with the current clang-format script. It also seems very temperamental - it must be used exactly in one way.

PatTheMav commented 4 months ago

That's intentional - it's designed to be run from the checkout directory by the GHA actions provided by the template and is only made available for convenience outside of that.

Any other use-case can and should be fulfilled by running the formatters directly (e.g. via a pre-commit hook) or using an IDE with appropriate formatting support.