ewolfe / prlint

GitHub App for linting pull request meta data
https://github.com/apps/prlint
MIT License
126 stars 9 forks source link

Cannot match characters at end of title #83

Closed alexsloan closed 5 years ago

alexsloan commented 5 years ago

Full disclaimer, I learnt 90% of the regex I know today!

I'm trying to match the last three characters of the PR title. Specifically, an ellipsis to find out if GitHub truncated the PR title.

The rule I have is:

  "title": [
    {
      "pattern": ".*[...]$",
      "message": "Please shorten your title so GitHub doesn't truncate it."
    }
  ],

I would expect it to match "My title..." It matches "My...title" (that's where my poor regex skills might be at fault). It also matches "My title ...X" where X is any single character including space but NOT including a fourth period.

I've tried various formulations of the regex pattern (most of them simpler), all with the same result. I've tried using "abc" instead of "..." and get the same thing. It seems to never match three characters if those are the last three.

alexsloan commented 5 years ago

Ok nvm, my bad. Fundamental error in that I'm matching what I don't want whereas PRLint matches for desired patterns.