Skip to content

Commit

Permalink
released 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-nour committed Jul 26, 2024
1 parent 39a4864 commit 16e20ea
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ gists-gone -l Unknown

#### Visbility

Using the `-visibility` option you can specify whether you want to delete public or private (secret) gists:
Using the `-visibility` option you can specify whether you want to delete public or secret gists:

```
gists-gone -v private
gists-gone -v secret
gists-gone -v public
```

Expand All @@ -99,10 +99,10 @@ Dates should be passed in YYYY-MM-DD format.

#### Examples

Deleting private (secret) gists created from 2020-01-01 onwards:
Deleting secret gists created from 2020-01-01 onwards:

```
gists-gone -v private -dr 2020-01-01 2100-01-01
gists-gone -v secret -dr 2020-01-01 2100-01-01
```

Deleting Rust gists created on a particular date:
Expand Down
6 changes: 3 additions & 3 deletions gists_gone/gists_gone.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def get_parser_args():
"-v",
"--visibility",
type=str,
help="Specify whether you want to delete public or private gists.",
help="Specify whether you want to delete public or secret gists.",
required=False,
choices=["public", "private"],
choices=["public", "secret"],
)

parser.add_argument(
Expand Down Expand Up @@ -147,7 +147,7 @@ def create_gists(json):
if visibility:
visibility = "public"
else:
visibility = "private"
visibility = "secret"

gist = Gist(raw_gist.get("id"), visibility, languages, date_created)
gists.append(gist)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "gists-gone"
version = "0.0.1"
version = "0.0.2"
description = "A CLI that gives you more granular control over bulk deletion of your Github gists."
readme = "README.md"
requires-python = ">=3.8"
Expand Down
10 changes: 5 additions & 5 deletions tests/test_gists_gone.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def test_create_gists_works(cli_args, requests_mock, mock_gists):
assert isinstance(gists, list)
assert gists[0] == Gist(
"7fea2e3837f324e5e3699917f687c862",
"private",
"secret",
"Clojure",
datetime(2024, 7, 12).date(),
)
Expand All @@ -199,7 +199,7 @@ def test_filter_gists_returns_list(created_gists):
def test_filter_gists_works_with_visibility(created_gists):
"""Test that filter_gists() works when the visibility argument is passed."""

arguments = ["private", None, None]
arguments = ["secret", None, None]
gist_ids = filter_gists(arguments, created_gists)
assert "7fea2e3837f324e5e3699917f687c862" in gist_ids
assert "5f6258f9caae6f2c6511e926f7f623af" in gist_ids
Expand Down Expand Up @@ -267,7 +267,7 @@ def test_filter_works_with_dates(created_gists):
def test_filter_works_with_multiple_arguments(created_gists):
"""Test that filter_gists works when different arguments are passed."""

arguments = ["private", ["Python"], None]
arguments = ["secret", ["Python"], None]
gist_ids = filter_gists(arguments, created_gists)
assert len(gist_ids) == 0

Expand All @@ -282,7 +282,7 @@ def test_filter_works_with_multiple_arguments(created_gists):
assert "8eaee095f4b3a822127cc4fa368b4165" in gist_ids
assert len(gist_ids) == 2

arguments = ["private", None, ["2024-07-12"]]
arguments = ["secret", None, ["2024-07-12"]]
arguments[2] = parse_date_arguments(arguments[2])
gist_ids = filter_gists(arguments, created_gists)
assert len(gist_ids) == 2
Expand All @@ -292,7 +292,7 @@ def test_filter_works_with_multiple_arguments(created_gists):
gist_ids = filter_gists(arguments, created_gists)
assert len(gist_ids) == 0

arguments = ["private", ["Rust", "Clojure"], ["2024-07-12"]]
arguments = ["secret", ["Rust", "Clojure"], ["2024-07-12"]]
arguments[2] = parse_date_arguments(arguments[2])
gist_ids = filter_gists(arguments, created_gists)
assert len(gist_ids) == 2
Expand Down

0 comments on commit 16e20ea

Please sign in to comment.