Skip to content

naming

Identifiers, files, and folders: banned words, case, length, and word count.

Always.

Checks every identifier against the naming settings: banned words, case, length, and word count.

Runs at the commit stage, only at the all level.

Names such as enhancedHandler, ensureConfigIfNeeded, and utils hide what the value holds or the code does.

Rename the thing after what it holds or does. To keep a name, list it exactly under allowed_names in a [[naming.exception]] record with a reason, or change a limit with gspot set naming.<language>.max_words.

export const userHelper = 1; reports the banned word helper. Rename it after what it holds, such as userCount.

Rule What it checks What to do
case A name uses a case that naming.<language>.<category>.cases lists. Rename it in a listed case.
digits A name holds no digit as a word. Name the difference, or set allow_digits in a [[naming.exception]] record with a reason.
length A name has at most naming.<language>.max_characters characters. Shorten the name, or raise the limit with a reason.
words A name has at most naming.<language>.max_words words. Split the code, or name the one concept that it holds.
duplicate-words A name repeats no word. Remove the repeated word, or set allow_repeated_words in a [[naming.exception]] record.
banned-word A name holds no word that naming.banned_words or a shipped word list bans. The shipped lists are folders of folders (shared, support, mocks); containers (core, common, generic, misc, stuff, thing, things, details, info, object, taxonomy); roles (helper, helpers, util, utils, manager, handler, processor, wrapper, shim, shims, shell, probe); marketing (advanced, enhanced, improved, intelligent, smart, modern, robust, seamless, ultimate, comprehensive, optimized, reusable, custom, final, latest, old, new, legacy, combined); defensive (ensure, maybe, likely, should, if needed, ifneeded, if available, ifavailable, if changed, ifchanged, if possible, ifpossible, or throw, orthrow, waitfor, with retries, transient, belt and suspenders, fallback, load bearing, load-bearing, loadbearing); conjunctions (and, or, with, when, what, whatever, once, plus); tests (test case, testcase, under test, undertest, edge case, edge cases, actual); abbreviations (dir, tmp, temp, cfg, conf, ctx, msg, btn, idx); generic verbs as the first word of functions and methods (execute, perform, manage, process, load, fetch, resolve, handle); bare verbs as the whole name of functions (run); prepositions as the first word of functions and methods (to, from, with, into); negated predicates as the first word (is not, is no, has not, has no, can not, can no). Choose a word that names the role, or keep the name through allowed_names in a [[naming.exception]] record.
syntax A file that the check reads parses without errors. Fix the syntax at the reported line.
gspot ignore naming/identifiers --paths "<path>" --reason "<why>"
gspot ignore naming/identifiers --rule case --reason "<why>"

Checks every file name, without its extension, and every folder name against the case rules of its language and the banned words.

Runs at the commit stage, only at the all level.

A file such as enhanced-utils.ts collects code with no clear place. One case rule keeps imports predictable.

Rename the file or folder, or add a path rule under [[naming.exception]] with a reason.

utils/format.js reports utils. Move it into the folder of the feature it serves, such as invoices/format.js.

Rule What it checks What to do
case A name uses a case that naming.<language>.<category>.cases lists. Rename it in a listed case.
digits A name holds no digit as a word. Name the difference, or set allow_digits in a [[naming.exception]] record with a reason.
length A name has at most naming.<language>.max_characters characters. Shorten the name, or raise the limit with a reason.
words A name has at most naming.<language>.max_words words. Split the code, or name the one concept that it holds.
duplicate-words A name repeats no word. Remove the repeated word, or set allow_repeated_words in a [[naming.exception]] record.
banned-word A name holds no word that naming.banned_words or a shipped word list bans. The shipped lists are folders of folders (shared, support, mocks); containers (core, common, generic, misc, stuff, thing, things, details, info, object, taxonomy); roles (helper, helpers, util, utils, manager, handler, processor, wrapper, shim, shims, shell, probe); marketing (advanced, enhanced, improved, intelligent, smart, modern, robust, seamless, ultimate, comprehensive, optimized, reusable, custom, final, latest, old, new, legacy, combined); defensive (ensure, maybe, likely, should, if needed, ifneeded, if available, ifavailable, if changed, ifchanged, if possible, ifpossible, or throw, orthrow, waitfor, with retries, transient, belt and suspenders, fallback, load bearing, load-bearing, loadbearing); conjunctions (and, or, with, when, what, whatever, once, plus); tests (test case, testcase, under test, undertest, edge case, edge cases, actual); abbreviations (dir, tmp, temp, cfg, conf, ctx, msg, btn, idx); generic verbs as the first word of functions and methods (execute, perform, manage, process, load, fetch, resolve, handle); bare verbs as the whole name of functions (run); prepositions as the first word of functions and methods (to, from, with, into); negated predicates as the first word (is not, is no, has not, has no, can not, can no). Choose a word that names the role, or keep the name through allowed_names in a [[naming.exception]] record.
gspot ignore naming/paths --paths "<path>" --reason "<why>"
gspot ignore naming/paths --rule case --reason "<why>"

Reports allowed names that no source file uses.

Runs at the commit stage, only at the all level, once for the repository.

An allowed name that nothing uses stays in gspot.toml after the code that needed it is gone.

Remove the record that matches nothing, or fix its name or path.

An allowed name that no source file contains reports an unmatched record. Remove the name, or correct it to the exact identifier and scope.

gspot ignore naming/allowed-names --paths "<path>" --reason "<why>"
Setting What it sets
naming.max_characters The most characters one identifier may have.
naming.max_words The most words one identifier may have.
naming.cases The case patterns that one identifier category accepts: camel, pascal, kebab, snake, upper-snake, pascal-extension (String+Format.swift), or timestamp-snake (20260103120000_create_users.sql). Ruff checks the case of Python classes, functions, and parameters, and SwiftLint checks Swift types, variables, parameters, and enum cases; this setting covers the rest.
naming.banned_words Words this repository bans in identifiers, beyond the shipped groups.
naming.terms Words this repository replaces, each with the word to use instead. The naming checks report the word in identifiers, and the prose checks in documentation, code comments, and commit messages. A scope adds its words to the root words.
naming.exception Naming rules for repository-relative paths, in order; each record has its reason.
Rule file Installed when
.gspot/rules/NAMING.md Always