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

Add more verbs scraped from another repository #131

Merged
merged 3 commits into from
Mar 22, 2024

Conversation

faern
Copy link
Contributor

@faern faern commented Mar 20, 2024

We ran into more missing verbs. So I figured instead of adding them a
few at a time when we run into issues, let's investigate what we
actually have used historically and batch add them. I did the
following for our largest repository, this is the only place where we
currently enforce git commit message style with this action:
https://github.com/mullvad/mullvadvpn-app/.

I grabbed all the first words from the subject line of our commits:

git log --format=%s | \
    awk '{print tolower($1)}' | \
    tr -cd '\n[:alnum:]._-' | \
    sort -u > first-words

I then filtered out the ones not already in
mostFrequentEnglishVerbs.ts:

for word in $(cat first-words);
do
    if ! grep -x "  '$word'," mostFrequentEnglishVerbs.ts > /dev/null;
    then
        echo "$word";
    fi;
done

I then manually started going through the list of words. Many of them
are not even verbs, or verbs not in imperative form, since we have not
enforced this style before. But many of them are perfectly fine
imperative form verbs and I suggest they are added to this action.

I stopped at the letter D and decided to submit this PR. That's
because I was not sure if you wanted this addition or not, and
figured I should reach out for feedback before spending more time.
I'll likely continue the filtering anyway, and add it to a local
path-to-additional-verbs in case you don't want them upstream. But
having them upstream would be way more handy, since then we can easily
run this on multiple repositories without having to duplicate the verb
list.

Semi-related question: Does it make sense to separate
"Verbs specific to programming"?
I personally think that distinction is not very important.

@faern
Copy link
Contributor Author

faern commented Mar 20, 2024

I found in total 184 verbs that I initially classified as reasonable verbs to have. I have a PR up to add this as an additional wordlist to our own repository. But I would love if we could upstream as much as possible! When we want to start checking multiple repositories it would be really good if we did not have to maintain a separate wordlist or a fork of this action. mullvad/mullvadvpn-app#5992

Tell me if you want this or not, so I know how to proceed :)

@mristin
Copy link
Owner

mristin commented Mar 20, 2024

Hi @faern ! This is definitely a nice addition!

Semi-related question: Does it make sense to separate
"Verbs specific to programming"?
I personally think that distinction is not very important.

No, not at this scale. Feel free to re-order the verbs alphabetically.

You can go ahead and add all the verbs -- I can quickly skim through the list to check that all of them are actually verbs so that nothing slips. Just ping me once I should review.

faern added 2 commits March 20, 2024 16:49
Add a bunch more verbs used in our repository that was not part of the
verb wordlist.
@faern faern force-pushed the add-some-verbs-a-through-d branch from 50ed978 to c9fada7 Compare March 20, 2024 15:50
@faern
Copy link
Contributor Author

faern commented Mar 20, 2024

Awesome! I'm glad to hear that. I have now pushed all our words! The first commit just adds our additional words. The second commit removes the distinction between "normal" and programmer verbs and sorts the list, so it's mostly automatically generated noise. Probably easiest to review the PR per commit.

@faern faern changed the title Add more verbs from A through D Add more verbs from a repository using this action Mar 20, 2024
@faern
Copy link
Contributor Author

faern commented Mar 20, 2024

@mristin Ping ;) This wordlist has passed internal review in my team, so it's already partially sanity checked. I hope you will like it.

One question that did pop up was whether or not abbreviations such as init and dedup should be in the list or not. I left them in since I felt they are very common programmer abbreviations for imperative verbs. But I can remove them if you think otherwise.

Another word we just ran into wanting
@mristin mristin changed the title Add more verbs from a repository using this action Add more verbs scraped from another repository Mar 22, 2024
@mristin mristin merged commit 623037e into mristin:master Mar 22, 2024
3 checks passed
@mristin
Copy link
Owner

mristin commented Mar 22, 2024

Thanks a lot, @faern ! Please let me know when I should publish a new patch version.

@faern
Copy link
Contributor Author

faern commented Mar 22, 2024

Awesome, thank you! Having a release would be amazing. I mean, I can't promise I won't come with more words in the coming few days also, but currently we could really use these 185 extra verbs :P

@faern
Copy link
Contributor Author

faern commented Mar 22, 2024

I'm not fluent in github actions. When I depend on this action, does it actually run the code in the dist/ directory? Because I tried depending on the commit hash for the master branch on this repo now, but it still does not accept "Source" as an OK verb.

uses: mristin/opinionated-commit-message@623037eb118a24335513cd7c4b2d4adabf292a8d

EDIT: Yes, that seems to be the case. I tried updating and checking in dist/ in our fork, and that works. Then I would love a release, so we can depend on upstream 🙏

@faern faern deleted the add-some-verbs-a-through-d branch March 22, 2024 08:41
@faern faern mentioned this pull request Mar 26, 2024
mristin pushed a commit that referenced this pull request Mar 27, 2024
In this release, we add a substantially more verbs.

*  Add "restart" and "coalesce" as allowed verbs #130 
*  Add more verbs scraped from another repository #131
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.

2 participants