Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legacy config file version found: "0.1". Upgrade to "0.2" #1532

Closed
Jason3S opened this issue Aug 16, 2021 · 1 comment
Closed

Legacy config file version found: "0.1". Upgrade to "0.2" #1532

Jason3S opened this issue Aug 16, 2021 · 1 comment

Comments

@Jason3S
Copy link
Collaborator

Jason3S commented Aug 16, 2021

Config File Version 0.2

The behavior changed between config version 0.1 and 0.2.

  • 0.1 - assumed the glob root was the current directory when cspell was run.
  • 0.2 - assumes the glob root matches the location of the config file.

The behavior is different between cspell 4.x and cspell 5.x

  • cspell version 4.x always uses the 0.1 logic.
  • cspell version 5.x only uses 0.1 logic if version: "0.1" is found.

The simple fix

Change "version": "0.1" to

"version": "0.2"

In most cases this should just work. But if you use cspell --config <path to config>/cspell.json to run CSpell, you
might need to add globRoot to the configuration.

Glob Root

  • globRoot - The root to use for glop patterns found in the configuration file.

Default: location of the configuration file.

For compatibility reasons, config files with version 0.1, the glob root will default to be ${cwd}.

Defining globRoot, does not impact imported configurations.

globRoot Values:

  • ${cwd} - will be replaced with the current working directory.
  • . - will be the location of the containing configuration file.
  • .. - will be the parent directory of the configuration file.
  • ../<path> - will resolve relative to the location of the configuration file.

Example: config/cspell.json

{
    "globRoot": "..",
    "files": "**",
    "ignorePaths": [
        "*.lock"
    ]
}
@Jason3S Jason3S pinned this issue Aug 16, 2021
@Jason3S Jason3S closed this as completed Sep 2, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant