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
# path to a gorules file for the ruleguard checker
rules: ''
Unfortunately, if you currently set a relative path, it will be relative to the directory that you run golangci-lint from. This means that you must always run golangci-lint from the same directory or use an absolute path, which may not work across different environments.
#1572 dealt with a similar issue for custom plugins. It fixed the issue by adding an explicit check to see if the path was relative or absolute.
I looked into doing this for the ruleguard settings, but it appears that the settings code is very generic and doesn't know anything in particular. Would a PR that added a special case to that code for ruleguard be accepted? I would understand if it would be considered in bad taste.
A more general alternative might be if golangci-criitc changed the working directory to the configuration dir directory before running the linters. However, I suspect this would cause other problems.
The text was updated successfully, but these errors were encountered:
I "solved" this by using a mustache template for the golangci.yml file. Before I invoke golangci-lint, I have a golangci.mustache file and use mustache to perform variable substitution and generate a golangci.ym.
I am using
ruleguard
via thegocritic
linter. As part of using this linter, you must set the path to your rules:golangci-lint/.golangci.example.yml
Lines 178 to 180 in 750309d
Unfortunately, if you currently set a relative path, it will be relative to the directory that you run
golangci-lint
from. This means that you must always rungolangci-lint
from the same directory or use an absolute path, which may not work across different environments.#1572 dealt with a similar issue for custom plugins. It fixed the issue by adding an explicit check to see if the path was relative or absolute.
I looked into doing this for the
ruleguard
settings, but it appears that the settings code is very generic and doesn't know anything in particular. Would a PR that added a special case to that code forruleguard
be accepted? I would understand if it would be considered in bad taste.A more general alternative might be if
golangci-criitc
changed the working directory to the configuration dir directory before running the linters. However, I suspect this would cause other problems.The text was updated successfully, but these errors were encountered: