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

feat: Add support for cache options in config files. #2184

Merged
merged 6 commits into from
Jan 6, 2022
Merged

Conversation

Jason3S
Copy link
Collaborator

@Jason3S Jason3S commented Jan 6, 2022

A new config section has been added, cache.

As a rule, any options specified on the command line override options in the configuration files.

cspell.json

{
    cache?: CacheSettings;
}

CacheSettings:

{
    /**
     * Store the results of processed files in order to only operate on the changed ones.
     * @default false
     */
    useCache?: boolean;

    // cspell:word cspellcache
    /**
     * Path to the cache location. Can be a file or a directory.
     * If none specified `.cspellcache` will be used.
     * Relative paths are relative to the config file in which
     */
    cacheLocation?: FSPathResolvable;

    /**
     * Strategy to use for detecting changed files, default: metadata
     * @default 'metadata'
     */
    cacheStrategy?: CacheStrategy;
}

New CLI Option --no-cache

  • --no-cache ensures that the cache is not used even if cspell.json has caching enabled.

A new config section has been added:

## `cache`

```ts
{
    cache?: CacheSettings;
}
```

## CacheSettings:

```ts
    /**
     * Store the results of processed files in order to only operate on the changed ones.
     * @default false
     */
    useCache?: boolean;

    // cspell:word cspellcache
    /**
     * Path to the cache location. Can be a file or a directory.
     * If none specified `.cspellcache` will be used.
     * Relative paths are relative to the config file in which
     */
    cacheLocation?: FSPathResolvable;

    /**
     * Strategy to use for detecting changed files, default: metadata
     * @default 'metadata'
     */
    cacheStrategy?: CacheStrategy;
```
@Jason3S Jason3S merged commit 7256919 into main Jan 6, 2022
@Jason3S Jason3S deleted the dev-cache-cfg branch January 6, 2022 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for configuring caching (cache, strategy, location) via configuration files
1 participant