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

Prevent run multiply copies golangci-lint with same params #108

Closed
rekby opened this issue Jun 15, 2018 · 4 comments
Closed

Prevent run multiply copies golangci-lint with same params #108

rekby opened this issue Jun 15, 2018 · 4 comments
Labels
enhancement New feature or improvement no decision No decision to fix or not

Comments

@rekby
Copy link

rekby commented Jun 15, 2018

When I edit files Goland can save many files same time (Ctrl+S after rename refactor or after manual changes few files).

If I add golangci-lint as filewatcher with project dir param - golangci-lint start many times - once for every saved file.

I think it will good for use some lock for prevent do work multiply times. For example - create lock-file/lock-dir flag with hash of current args and env.

If lock file existed - exit with code 0.

Check lock flag for old file (for example - ignore it after a hour) - for prevent forever lock in some mistakes.

@alecthomas
Copy link
Contributor

IMO this seems like an issue that is not particular to golangci-lint and should be solved in the general case by Goland.

@jirfag jirfag added enhancement New feature or improvement no decision No decision to fix or not labels Jun 15, 2018
@rekby
Copy link
Author

rekby commented Jun 15, 2018

IDE can't know purpose of calls - it only exec command while change file.
May be I want count changes per directory.

I see 3 variants of decision:

  1. Some lock schema in linter. May be not use hash, etc. But simple param --lock and use the lock file if parameter exists only.
  2. Way to run linter for file, not whole folder - for run from watcher personally for file and doesn't analyse whole dir.
  3. Additinal settings in IDE for run only one watcher same time.

@sudo-suhas
Copy link

As I mentioned in the duplicate issue, the problem occurs for vscode as well.

@tpounds tpounds added the stale No recent correspondence or work activity label Oct 1, 2019
@jirfag
Copy link
Member

jirfag commented Oct 13, 2019

Fixed in #812

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement no decision No decision to fix or not
Projects
None yet
Development

No branches or pull requests

5 participants