Skip to content

Commit

Permalink
Refactor and bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
EricFernandezSnyk committed Sep 23, 2022
1 parent 05ba296 commit 7ff7360
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 342 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
**Snyk Tags is a CLI tool which can:**

- Help filter Snyk projects by product type by adding product tags across a Snyk Group or Organization - using ```snyk-tags tag```
- Help filter Snyk projects by applying tags to all projects containing a specific name ```snyk-tags tag alltargets --contains-name=```
- Help filter Snyk projects by applying tags to a target import (for example a git repo like **snyk-labs/nodejs-goof**) - using ```snyk-tags target tag``` or from a csv/json file with ```snyk-tags fromfile target-tag```
- Help filter Snyk projects by applying attributes to a target import (for example a git repo like **snyk-labs/nodejs-goof**) - using ```snyk-tags target attributes``` or from a csv/json file with ```snyk-tags fromfile target-attributes```
- Help filter Snyk projects by adding the GitHub Code Owner as a tag to target import (must be a GitHub repo in the form **snyk-labs/nodejs-goof**) - using ```snyk-tags target github```
Expand Down
10 changes: 5 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "snyk-tags"
version = "1.1.0"
version = "1.2.0"
description = "CLI tool designed to manage tags and attributes at scale"
authors = ["EricFernandezSnyk <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion snyk_tags/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# snyk_tags/__init__.py

__app_name__ = "snyk_tags"
__version__ = "1.1.0"
__version__ = "1.2.0"

from logging import ERROR
from sre_constants import SUCCESS
Expand Down
8 changes: 6 additions & 2 deletions snyk_tags/remove.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ def tag_from_target(
remove_tags_from_projects(snyktkn, org_id, target, tagValue, tagKey)


@app.command(help=f"Remove a tag from all targets, on projects containing a common shared name")
@app.command(
help=f"Remove a tag from all targets, on projects containing a common shared name"
)
def tag_from_alltargets(
org_id: str = typer.Option(
..., # Default value of comamand
Expand Down Expand Up @@ -173,7 +175,9 @@ def tag_from_alltargets(
typer.secho(
f"\nRemoving {tagKey}:{tagValue} from projects within {org_id}", bold=True
)
remove_tags_from_projects_by_name(snyktkn, org_id, contains_name, name_ignorecase, tagValue, tagKey)
remove_tags_from_projects_by_name(
snyktkn, org_id, contains_name, name_ignorecase, tagValue, tagKey
)


@app.command(help=f"Remove a tag from a Group, this can be forced through --force")
Expand Down
Loading

0 comments on commit 7ff7360

Please sign in to comment.