Skip to content

Provide an option to ignore paths #184

Closed
@fmigneault

Description

@fmigneault
  • bump-my-version version: 0.20.3n
  • Python version: 3.10.13
  • Operating System: Ubuntu 20.04 LTS

Description

Provided that a glob pattern can be used to look "everywhere", bump-my-version loses time looking up many irrelevant locations. This makes it harder to inspect --dry-run --verbose outputs due to the amount of paths crawled. An ignore or exclude configuration option would help preemptively ignore many known paths. Ideally, a list of patterns would be supported so that we can specify for example:

[tool.bumpversion]
ignore = [
  "node_modules/",
  "build/",
  "dist/",
]

What I Did

Example config that looks for a very specific pattern anywhere in the repository:

[tool.bumpversion]
current_version = "1.0.0"
ignore_missing_version = true
ignore_missing_files = false

[[tool.bumpversion.files]]
glob = "**/*.json"
search = "https://crim-ca.github.io/mlm-extension/v{current_version}/schema.json"
replace = "https://crim-ca.github.io/mlm-extension/v{new_version}/schema.json"

Using --verbose quickly highlights a massive list of "unmatched files" (as expected) in loads of node_modules, temporary build dirs, etc.

The current alternative is to list more specific nested directories (e.g.: src/**/*.json), but all locations might not be known in advance, and causes many [[tool.bumpversion.files]] to be duplicated of each sub-dir to support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions