Examples

Basic usage

The file .gitignore must have a line with the content /dist/.

style = "style.json"

Project config self configuration

project-config is defining a valid configuration, forcing the definition of styles as an array for styles and a valid cache value.

style = ["style.json5"]
cache = "5 minutes"

Files absence

The files readme.md and index.md must not exist.

style = "style.yaml"

Conditionals

If .gitignore includes the line __pycache__/ a pyproject.toml file must be present.

style = "style.json"

Conditionals files existence

  • 1st rule: if the directory src/ exists, the file pyproject.toml must exists too.

  • 2nd rule: if the file pyproject.toml exists, a Python file must be present in the root directory.

style = "style.json5"

Compare values between serializable files

The version defined in __version__ inside a Python script must match the metadata defined in pyproject.toml file.

style = "style.toml"

JMESPath against online sources

Check that the license field of package.json file is defined with a valid OSI approved SPDX license identifier.

style = "style.json5"

Tip

For more complex examples check my own styles at mondeja/project-config-styles.