GistTree.Com
Entertainment at it's peak. The news is by your side.

Nice check-spelling action for GitHub

0

Overview

All and sundry makes typos. This involves individuals writing documentation and comments,
nonetheless it moreover involves programmers naming variables, choices, apis, classes,
and filenames.

Continually, programmers will use InitialCapitalization, camelCase,
ALL_CAPS, or IDLCase when naming their things. After they value this, it makes
it great more durable for naive spelling instruments to glimpse misspellings, and as such,
with a extremely excessive false-obvious payment, individuals don’t are inclined to enable spellchecking
at all.

This repository’s instruments are able to tolerating all of these variations.
Specifically, w understands
enough about how programmers name things that it must atomize up the above conventions
into phrase-be pleased things for checking against a dictionary.

Spell Checker GitHub Actions

Spell checking

Extra knowledge

Sample output

Observation as considered in a PR

github action comment

Observation as considered in a commit

github action annotation

The GitHub Action Ride log

github action log

Popular Configuration

Variables

Variable Description
bucket file/url for which the instrument has read gather admission to to a pair of files.
mission a folder within bucket. This lets you part identical old objects across tasks.
timeframe desire of minutes (default 60) to set up into myth when a time table workflow assessments for updated PRs.
GITHUB_TOKEN Secret aged to retrieve your code and comment on PRs/commits.
bucket
  • unset – particularly before all the things…
  • ./route – a local itemizing
  • ssh://git@*, git@* – git urls (if the url is no longer always for github, you might well maybe must bear location up credentials)
  • https:// (or http://) – curl effectively matched
  • gs:// – gsutil url
mission
  • unset – particularly before all the things
  • branch – for git urls
  • ./ – at the same time as you happen to don’t desire an additional nesting layer
  • itemizing – particularly for sharing a identical old bucket across plenty of tasks
timeframe

Normal by the time table action. Any launch pull requests from every other repository
will be checked, and if the commit is within that timeframe, this would also be processed.

Files

Existing that every of the below objects can either be a file w/ a .txt suffix,
or a itemizing, the assign every file with a .txt suffix will be merged together.

Variable Description
advice This lets you complement the comment.
enable This lets you complement the dictionary.
dictionary This lets you replace the dictionary.
excludes This lets you skip checking files/directories.
demand This defines the listing of phrases in the repository that aren’t in the dictionary.
perfect This lets you limit checking to definite files/directories.
patterns This lets you account for patterns of acceptable strings.
reject This lets you establish away objects from the default dictionary.
advice

This provides a supplemental part to the comment
posted to github. Or no longer it is freeform. Chances are high you’ll maybe use
it to demonstrate how contributors must decide on out
the assign to assign new entries.

enable

This permits you so as to add supplemental phrases to
the dictionary without relacing the core dictionary.

dictionary

This replaces the default dictionary.
One phrase per line.

If you happen to be pleased to bear to encompass the default dictionary,
assign it into the itemizing subsequent to your own.

excludes

This file contains Perl traditional expressions.
In general, one traditional expression per line.
They are merged the use of an OR (|).

Files matching these patterns will be skipped.

Likely examples encompass:

(?:^|/)seller/
(?:^|/)yarn.lock$
LICENSE
.pdf$
.png$
.xslx?$
^CONTRIBUTING.md$
^.github/action/spell-test/
^.github/workflows/

Strains that launch with # will be no longer infamous.

demand

This contains of anticipated “phrases” that aren’t in the dictionary, one phrase per line.
Anticipated phrases which might perhaps be no longer otherwise expose in the corpus will be urged for elimination,
nonetheless is no longer going to location off a failure.

Words which might perhaps be expose (i.e. no longer matched by the excludes file) in the repository
and which are not listed in the demand listing will location off a failure as fragment of push and
pull_request actions (reckoning on how you bear configured this action).

Chances are high you’ll maybe use # followed by text so as to add a comment at the close of a line..
Existing that some automatic pruning might perhaps moreover no longer effectively handle this.

➡️ Until you add an demand file, the output will perfect be supplied in the GitHub
Action Ride Log
.

  • Here is on myth of it be assumed that you simply might well maybe desire to gather
    some tuning (potentially adding excludes and presumably adding patterns) ahead of
    the action begins commenting on commits.
  • Chances are high you’ll maybe merely reproduction the listing from that output.

⚠️ This became as soon as previously called whitelist — that name is deprecated.
Make stronger for the deprecated name might perhaps be removed in a future liberate.
Until then, warnings will be reported in the action speed log.
At a future date, comments might perhaps moreover legend this as effectively.

perfect

This file contains Perl traditional expressions.
In general, one traditional expression per line.
They are merged the use of an OR (|).

Files no longer matching these patterns will be skipped.

Likely examples encompass:

.pl$
.js$
.py$

Strains that launch with # will be no longer infamous.

patterns

This file contains Perl traditional expressions.
In general, one traditional expression per line.
Strains that delivery with # will be skipped.
They are merged the use of an OR (|).

Tokens within files that match these expressions will be skipped.

Likely examples encompass:

# this will likely be a comment
https?://(?:(?:www.|)youtube.com|youtu.be)/[-a-zA-Z0-9?&=]recordsdata: [a-zA-Z=;,/0-9+]+
# c99 hex digits (no longer the beefy structure, correct one I've considered)
0x[0-9a-fA-F](?:.[0-9a-fA-F]*|)[pP]
# hex digits including css/html coloration classes:
(?:0[Xx]|U+|#)[a-f0-9A-FGgRr]{2,}[Uu]?[Ll]{0,2}b
# uuid:
{[0-9A-FA-F]{8}-(?: [0-9A-FA-F]{4}-){3}[0-9A-FA-F]{12}}
# the unfavorable lookahead here is to enable catching 'templatesz' as a misspelling
# nonetheless to otherwise glimpse a Dwelling windows route with templatesfoo.template or the same:
\templates(?![a-z])
# ignore long runs of a single persona:
b([A-Za-z])1{3,}b
# Existing that the subsequent instance is no longer any longer needed at the same time as you happen to are the use of
# to compare a string starting with a `#`, use a persona-class:
[#]backwards
reject

This lets you establish away phrases from the dictionary
without having to replace the core dictionary.

The repeat of operations is:

(dictionary + allows) - reject

No longer mandatory Configuration Variables

Variable Description
VERBOSE 1 at the same time as you happen to be pleased to must be reminded of what number of phrases are on your demand listing for every speed.

Behavior

  • This action will routinely comment on PRs / commits with its idea.
  • This would maybe moreover try to identify a restricted desire of traces containing the phrases it
    would no longer glimpse.

Limitations

  • GitHub Actions customarily don’t speed on forked repositories except the forking particular person enables them.
  • Pull Requests from forked repositories speed with read-perfect permissions.
    • To be definite some coverage for such PRs, you might well maybe add a time table.

MIT

Read More

Leave A Reply

Your email address will not be published.