-
Notifications
You must be signed in to change notification settings - Fork 57
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
An error occurs when the SVN is used #51
Comments
What OS are you on and which version of Lua is involved here? It looks to me like something didn't get installed right. How did you install Luacheck? Are you able to run it on projects without SVN involved or not from a pre-commit hook? |
os:centos7 |
Hello, today I looked at the code and solved the problem. The main reason is that :
main.lua line212 local cache_opt = parser:option("--cache", ("Path to cache directory. (default: %s)"):format(cache.get_default_dir()))
:args "?"
"cache.get_default_dir()" there is no correct return value
so before I call luacheck ,I set env
'export XDG_CACHE_HOME="/var/cache/luacheck"'
Now, it works correctly
but, However, I think this is a bug, Because event I use it "--no-cache", it still can not pass
Sorry, my English is so poor, I hope you can understand
…________________________________
发件人: Caleb Maclennan ***@***.***>
发送时间: 2022年3月2日 17:48
收件人: lunarmodules/luacheck ***@***.***>
抄送: renzijing ***@***.***>; Author ***@***.***>
主题: Re: [lunarmodules/luacheck] An error occurs when the SVN is used (Issue #51)
What OS are you on and which version of Lua is involved here? It looks to me like something didn't get installed right. How did you install Luacheck? Are you able to run it on projects without SVN involved or not from a pre-commit hook?
―
Reply to this email directly, view it on GitHub<#51 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/APNX6HG3ZM7QLUMAOJ46IULU542PHANCNFSM5PWY4EKQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I can look into whether In the mean time, at least one of |
I have evn #HOME, this issue only appear in my svn pre-commit hook, Otherwise it's normal, like shell |
Are you by any chance using @pre-commit? This might be a duplicate of #52 and completely miss-diagnosed here. If you have |
I can't make heads or tails of this. It doesn't seem to be an exactly duplicate of #52 (which will be patched soon an included in 0.26.0). Perhaps @asottile can answer if there is there any chance pre-commit is calling |
@pre-commit doesn't at the moment support svn so that being the cause is a little unlikely |
only for SVN projects |
Please confirm the function of luacheck outside of your SVN hook script. Just run |
I've been using it lately. All other invocation methods are fine except SVN hook |
Okay I've confirmed what is going on. Even if HOME=/tmp luacheck --no-cache . I'll see if there is a way to not try to even guess a default cache location unless it is going to be used. |
I might have a problem with what I said earlier, now I'm using the command |
The syntax / quoting of that export is entirely wrong. Also if you just want to set a variable for one command you don't need export at all. Try one of these: XDG_CACHE_HOME=/var/cache/luacheck luacheck xxxxx
# or
luacheck --cache /var/cache/luacheck xxxxx
# or for no cache at all
HOME=/tmp luacheck --no-cache xxxxx |
You're doing something completely different. Of course you do need to export if you're running a chain of commands (as |
The release version didn't work at the beginning, I changed it to the code version, but I found the same problem after changing the code version |
I'm sorry I don't understand what you mean at all. Did you try building your own Luacheck from the code in PR 60? With the current release version, you must specify one of With the version in PR 60 (which will be in the next release) you will be able to not specify any environment variable (in which case it will default to the current directory) or be able to add |
I use the current version, not PR 60, export XDG_CACHE_HOME, It can use in svn hook. |
Call luacheck on the SVN pre-commit, for example,
luacheck -v
, error when commit code,The text was updated successfully, but these errors were encountered: