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

Implement skip repos option #74

Merged
merged 3 commits into from
Jul 4, 2021

Conversation

francislavoie
Copy link
Contributor

@francislavoie francislavoie commented Jul 3, 2021

Fixes #73, specifically the first suggestion there.

I didn't actually test this. Just made the code changes. I don't super feel like playing with the build tooling right now, sorry 😅

  • I updated the .editorconfig because it was misaligned with what the files in the project were actually wanting.
  • Removed an orphan </div> which didn't have an opener anymore, unindented.
  • Unindented a 4-space indented block of HTML.

Let me know if you want me to drop these changes, I kept them in a separate commit just in case.


  • Add SKIP_REPOS_KEY to the prefs storage, simple string from a textarea input.
  • Using .split(/[\s\n,]+/) to turn the options into an array. This allows for repos to be separated by comma, space, or newline. So something like "foo bar,,baz\n\nfoobar" turns into ["foo", "bar", "baz", "foobar"] which is pretty clean.
  • Using .some to find if any of the skipped repos contain the string user + "/" + repo. So for example if the skip list has https://github.com/foo/foo, https://github.com/bar/bar, then it should return true for foo/foo and bar/bar as the user/repo and return false for baz/baz.
  • Simply returns to avoid showing the UI. Following the lead of the starGazers part which does a simple return.
  • Doing this as early as possible to avoid doing extra work with JSON parsing etc if it should be skipped.

Hopefully this all makes sense. Hopefully I got the HTML to look right (took a quick peek at semantic-ui docs, never used it before).

@musically-ut musically-ut self-requested a review July 3, 2021 15:57
Copy link
Owner

@musically-ut musically-ut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. ✨

@musically-ut
Copy link
Owner

Thanks for the PR!

I'll test it out locally, merge it, and ship it to the store soon!

@musically-ut
Copy link
Owner

Nit: Would you mind adding a small link/changelog to the Acknowledgements section in the README.md? 🙃

@musically-ut musically-ut merged commit f192418 into musically-ut:master Jul 4, 2021
@francislavoie francislavoie deleted the skip-repos branch July 4, 2021 14:42
@francislavoie
Copy link
Contributor Author

Thanks for merging! I can confirm it works as I was intending 😁

@musically-ut
Copy link
Owner

💫

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exclude/skip list for repos you don't want to see the forks for
2 participants