sindresorhus / awesome-lint

Linter for Awesome lists
MIT License
600 stars 56 forks source link

--offline avoids github tests (no internet); clone depth 1 #183

Closed WillForan closed 8 months ago

WillForan commented 8 months ago

I was traveling and noticed awesome-lint was very slow without access to github.com.

I'm sure that's an unusual use case, so maybe it's not worth a dedicated CLI. But in case otherwise, here's the change that I think would avoid needing internet access.

sindresorhus commented 8 months ago

Would be better to add a timeout for the slow operation.

WillForan commented 8 months ago

timeout seems like a good general solution. 2 implementation questions:

  1. is there an good way to send/inject a configurable timeout setting into the github (or any other) rule? Or a better place to watch for timeouts?
  2. after timeout, should there still be a github error in lint messages? Not if timeout==0?
sindresorhus commented 8 months ago
  1. I was not thinking of a configurable timeout, just make a hard-coded timeout with a sensible value.
  2. Only if a URL was specified.
WillForan commented 8 months ago

I think the default behavior is to time out already! I just didn't like waiting :)

It seems reasonable to reject this pull request -- awesome-lint does the reasonable thing already without command arguments sloshing around 2 files b/c one person is impatient.

If it's useful, I'm happy to make a separate very small pull for the --depth 1 change -- and more so if you don't need me involved for the change. Kill the other parts of this request or DIY elsewhere. Whatever's easier.

sindresorhus commented 8 months ago

If it's useful, I'm happy to make a separate very small pull for the --depth 1 change

👍