Skip to content

Document the usethis_config class better #1099

Description

@nathanjmcdougall

In usethis._config.usethis_config we keep global state which changes the application behaviour, e.g. whether some categories of messages are suppressed, whether we should run in offline mode, etc.

This can be used as a context manager to temporarily over-ride the global state.

The command line interface can also set some of these global settings via flags (again, via the context manager).

Discussing this in CONTRIBUTING.md under the architecture section would be good.

The main purpose of this is to avoid pass-through variables. In copilot-instructions.md we need to make it clear that it is not acceptable to add new global state unless there is a very good reason and the state is useful across many different commands, across the whole application. The purpose is to control application behaviour, not the specific behaviour of one command in the CLI.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions