Skip to content

Change settings

gspot writes every generated file from gspot.toml, so to change how a tool runs, change gspot.toml, not the config file of the tool. gspot add, remove, set, unset, ignore, and unignore edit gspot.toml and write the generated files again, and they keep your comments and the order of your settings.

gspot list
gspot list settings
gspot explain limits.max_file_lines

gspot list prints the configurations in use and the state of each check. gspot list settings prints each setting, its whole value, when it needs a reason, and where the value comes from, and --json prints a row for each scope. gspot explain <setting> prints one setting, its default, and the command that changes it. The settings reference lists every key.

gspot add vitest
gspot remove nextjs --reason "The app does not use Next.js."

gspot remove saves the name and your reason under removed_configurations, so gspot stops suggesting that configuration, and gspot add nextjs undoes the removal. gspot refuses to remove a configuration that another configuration in use needs. You cannot add or remove a configuration that is always on, such as spelling, so ignore its checks instead. When the configurations need new tools, run gspot install.

When you add files of a language or framework that no configuration in use covers, gspot/detected-configurations fails and names the command to run:

gspot.toml:1 detected-configuration No check reads bash (1 .sh file). Run gspot add bash, or gspot remove bash --reason "<why>".

Run that gspot add command, then gspot install. The check does not suggest a configuration in removed_configurations.

When you delete all the files of a configuration, gspot skips its checks, and the configuration, its settings, its ignores, and its command checks stay in gspot.toml.

Command What it does
gspot set <setting> <value...> Writes your value in place of the default.
gspot unset <setting> Removes your value and its reason, so the default applies again.
gspot unset <setting> <item...> Removes items from a list, or keys from a table.

gspot set replaces a whole list, so give every value that the list must hold. For example, dependencies.allowed_registries holds registry.npmjs.org and registry.yarnpkg.com by default, so a mirror takes all three hosts:

gspot set dependencies.allowed_registries registry.npmjs.org registry.yarnpkg.com npm.example.com --reason "The company mirror of npm."

A setting that holds a table takes one TOML inline table, and gspot adds its keys and keeps the others. spelling.allowed_words takes its words and one --reason instead. To pass a value that starts with -, put -- before the values:

gspot set ci.setup_command -- bun install --frozen-lockfile

To change a setting for one folder only, add --scope <path>, as Settings in a scope shows. When a change empties a setting that a check needs, gspot set and gspot unset print This turns off <check>.

A value weaker than the shipped default needs --reason, such as a raised limit, a lower coverage minimum, or a new entry in an allow list. A reason has two or more words. gspot set takes --reason on every key that holds one, and the column needs a reason when of gspot list settings shows when it needs one:

gspot set limits.max_function_lines 80 --reason "The parser is one state machine."
gspot.toml
[limits]
max_function_lines = { value = 80, reason = "The parser is one state machine." }

gspot unset takes no reason, so to give one, run gspot set <setting> <value> --reason "<why>".

gspot/weakenings runs before each push and in CI, and lists each change that makes the checks less strict:

  • a new ignore, or an ignore that covers more
  • a removed configuration
  • a lower level
  • a weaker setting, such as a raised limit
  • the Git hooks or the rule files turned off
  • an [[import_rule]] record that goes away, gains a path, or may import more rules
  • a folder that leaves javascript.import_boundaries
  • options in tools.eslint.rules that leave out or change a key of the options that gspot ships for the rule

A change with a reason prints as a note, and a change without one fails the check. The check compares gspot.toml with its version before your change: where the pushed commits start, the revision that --base names, or the last commit. When that version does not fit the schema, as after an upgrade, the check reads it without the keys that the schema refuses. When it still does not fit, the check compares with the shipped defaults. Only CI or a run by hand reports the change when the hooks are off.

level, hooks.enabled, rule_files, javascript.import_boundaries, and tools.eslint.rules hold no reason, so gspot set refuses --reason on them, and an [[import_rule]] record holds none either. Give the reason with an ignore of the matching rule of gspot/weakenings, which also covers later changes of that kind:

gspot ignore gspot/weakenings --rule level --reason "The team moves to level all after the release."

The rules are level, hooks, rule-files, import-rule, and rule-options. gspot rejects an ignore of the whole check, so that it keeps running.

gspot ignore writes [[ignore]]. gspot set, unset, add, and remove with --scope add a [[scope]] for a folder that holds a project file. Write the rest yourself, then run gspot check --fix or gspot install:

Record Holds
[[command_check]] A command of your own, run as a check.
[[import_rule]] A layer of your code and the layers it may import.
[[format.override]] Formatting for some files.
[[naming.exception]] Names that the naming checks accept in some files.
[[tools.eslint.override]] ESLint rule options or a runtime for some files.
[[tools.eslint.plugins]] ESLint rules from a plugin.
[[tools.stylelint.plugins]] Stylelint rules from a plugin.
[[javascript.banned_imports]] An import to refuse, and what to import instead.
[[coverage.swift_target]] The coverage minimum of one Swift target.
[[licenses.allowed_package]] One package version allowed under a license you reviewed.
[[json.schemas]] A JSON Schema for data files that SchemaStore does not know.

gspot set and gspot unset also take javascript.banned_imports and the two plugin lists, as one inline TOML list.

After a hand edit, preview the changes to the generated files, then write them:

gspot check --only gspot/generated-files --verbose
gspot check --fix --only gspot/generated-files

gspot check --fix rewrites the stale generated files. gspot install rewrites them too, then installs the tools and writes the tool lockfiles under .gspot/, so run it when the edit needs a new tool.

gspot.toml uses TOML 1.0, so keep each inline table on one line. Editors shows how to validate the file as you type.

At level all, the naming checks reject vague words in names. The roles list rejects job labels, such as helper and manager. The defensive list rejects qualifiers, such as ensure and maybe, and the marketing list rejects claims, such as advanced and enhanced. To ban more words in your project, add them to naming.banned_words.

For export const helperCommand = 1;, naming/identifiers reports:

javascript variable "helperCommand": "helper" is banned (roles list).

Accept a name only when something outside your code requires that exact name, such as an external API. This record accepts the name in one file, and the naming checks still check the other names in that file:

gspot.toml
[[naming.exception]]
paths = ["helper.js"]
categories = ["variables"]
allowed_names = ["helperCommand"]
reason = "An external API requires this exact name."

The level decides which rules run, and each gspot release pins the tool versions, so a level means the same rules in every repository that pins the same gspot version.

  • To run a rule that only level all turns on, set the level to all, then ignore the rules that you do not want. Ruff is the one exception: tools.ruff.rules adds a rule at any level.
  • You cannot make a rule warn instead of fail.
  • You cannot move a shipped check to another stage. Only your own command checks set stage.
  • A tool option that has no setting in gspot.toml stays as gspot writes it. To add rules, use an ESLint or Stylelint plugin record or a Semgrep rule file. To run another tool, add a command check.