# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns

# Automatically suggested patterns
# hit-count: 1262 file-count: 4
# ANSI color codes
(?:\\(?:u00|x)1[Bb]|\x1b|\\u\{1[Bb]\})\[\d+(?:;\d+|)m

# hit-count: 743 file-count: 13
# hex runs
\b[0-9a-fA-F]{16,}\b

# hit-count: 739 file-count: 6
# base64 encoded content, possibly wrapped in mime
(?:^|[\s=;:?])[-a-zA-Z=;:/0-9+]{50,}(?:[\s=;:?]|$)

# hit-count: 215 file-count: 101
# https/http/file urls
(?:\b(?:https?|ftp|file)://)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]

# hit-count: 94 file-count: 3
# sha
sha\d+:[0-9]*[a-f]{3,}[0-9a-f]*

# hit-count: 46 file-count: 34
# GitHub SHAs (markdown)
(?:\[`?[0-9a-f]+`?\]\(https:/|)/(?:www\.|)github\.com(?:/[^/\s"]+){2,}(?:/[^/\s")]+)(?:[0-9a-f]+(?:[-0-9a-zA-Z/#.]*|)\b|)

# hit-count: 44 file-count: 10
# version suffix <word>v#
(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_]))

# hit-count: 25 file-count: 25
# node packages
(["'])\@[^/'" ]+/[^/'" ]+\g{-1}

# hit-count: 16 file-count: 9
# in a version of check-spelling after @0.0.21 printf markers won't be automatically consumed
# printf markers
(?<!\\)\\n(?=[a-z]{2,})

# hit-count: 10 file-count: 2
# uuid:
\b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b

# hit-count: 10 file-count: 1
# css url wrappings
\burl\([^)]+\)

# hit-count: 8 file-count: 8
# JavaScript regular expressions
# javascript test regex
/.*/[gim]*\.test\(

# hit-count: 8 file-count: 6
# javascript replace regex
\.replace\(/[^/\s"]*/[gim]*\s*,

# hit-count: 6 file-count: 4
# tar arguments
\b(?:\\n|)g?tar(?:\.exe|)"?(?:(?:\s+--[-a-zA-Z]+|\s+-[a-zA-Z]+|\s[ABGJMOPRSUWZacdfh-pr-xz]+\b)(?:=[^ ]*|))+

# hit-count: 4 file-count: 3
# base64 encoded content
([`'"])[-a-zA-Z=;:/0-9+]+=\g{-1}

# hit-count: 4 file-count: 2
# URL escaped characters
\%[0-9A-F][A-F]

# hit-count: 4 file-count: 2
# go install
go install(?:\s+[a-z]+\.[-@\w/.]+)+

# hit-count: 3 file-count: 3
# stackexchange -- https://stackexchange.com/feeds/sites
\b(?:askubuntu|serverfault|stack(?:exchange|overflow)|superuser).com/(?:questions/\w+/[-\w]+|a/)

# hit-count: 3 file-count: 2
# hex digits including css/html color classes:
(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|[iu]\d+)\b

# hit-count: 3 file-count: 2
# IServiceProvider / isAThing
\b(?:I|isA)(?=(?:[A-Z][a-z]{2,})+\b)

# hit-count: 2 file-count: 2
# sha-... -- uses a fancy capture
(\\?['"]|&quot;)[0-9a-f]{40,}\g{-1}

# hit-count: 2 file-count: 2
# assign regex
= /[^*]*?(?:[a-z]{3,}|[A-Z]{3,}|[A-Z][a-z]{2,}).*/

# hit-count: 2 file-count: 2
# regex choice
\(\?:[^)]+\|[^)]+\)

# hit-count: 1 file-count: 1
# gist github
\bgist\.github\.com/[^/\s"]+/[0-9a-f]+

# hit-count: 1 file-count: 1
# lower URL escaped characters
\%[0-9a-f][a-f](?=[a-z]{2,})

# hit-count: 1 file-count: 1
# javascript match regex
\.match\(/[^/\s"]*/[gim]*\s*

# hit-count: 1 file-count: 1
# Go regular expressions
regexp?\.MustCompile\(`[^`]*`\)

# Questionably acceptable forms of `in to`
# Personally, I prefer `log into`, but people object
# https://www.tprteaching.com/log-into-log-in-to-login/
\b(?:[Ll]og|[Ss]ign) in to\b

# to opt in
\bto opt in\b

# typos in translation keys
^\s*(?:calllback|objectReferance|requriedInt):$

# bug https://github.com/rancher-sandbox/rancher-desktop/pull/5030#discussion_r1239065212
\bnamesapce: isContainerd\b

# adduser and friends
\s-g (\w+)\s+\g{-1}\s
# acceptable duplicates
# ls directory listings
[-bcdlpsw](?:[-r][-w][-Ssx]){3}\s+\d+\s+\S+\s+\S+\s+\d+\s+
# mount
\bmount\s+-t\s+(\w+)\s+\g{-1}\b
# C types and repeated CSS values
\s(auto|BUG|builder|center|div|inherit|long|LONG|none|normal|solid|thin|TODO|transparent|very)(?: \g{-1})+\s
# C struct
\bstruct\s+(\w+)\s+\g{-1}\b
# go templates
\s(\w+)\s+\g{-1}\s+\`(?:graphql|inject|json|yaml):
# doxygen / javadoc / .net
(?:[\\@](?:brief|groupname|t?param|return|retval)|(?:public|private)(?:\s+static|\s+readonly)*)(?:\s+\{\w+\}|)\s+(\w+)\s+\g{-1}\s

# Commit message -- Signed-off-by and friends
^\s*(?:(?:Based-on-patch|Co-authored|Helped|Mentored|Reported|Reviewed|Signed-off)-by|Thanks-to): (?:[^<]*<[^>]*>|[^<]*)\s*$

# Autogenerated revert commit message
^This reverts commit [0-9a-f]{40}\.$

# ignore long runs of a single character:
\b([A-Za-z])\g{-1}{3,}\b

# Don't check names in dependabot.yml reviewers section
^\s+reviewers:\s*\[\s*"[^",]+"\s*\]

# Directives to skip the current full line (intended for extension names and
# their related account names):
^.*spellcheck-ignore-line.*$

# Don't check package names
^\s*zypper\b.*\binstall\b.*

# Allow golangci in GitHub workflows:
\buses:\s*golangci/golangci-lint-action\b

# on macOS, MacOS is used for the internal folder name within an app...
(["/])MacOS\g{-1}

# GitHub owner names should not be checked (dependency scripts)
\bgithubOwner\s*=\s*'.*?'

# Win32 constants
\bGWL_EXSTYLE\b
\bHWND_NOTOPMOST\b
\bSWP_NOMOVE\b
\bSWP_NOSIZE\b

# allow repetitive words in iptable rules
DNAT\s+.*\s+anywhere anywhere
