checkmarks 0.3.0__tar.gz → 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. {checkmarks-0.3.0/src/checkmarks.egg-info → checkmarks-0.4.0}/PKG-INFO +4 -25
  2. {checkmarks-0.3.0 → checkmarks-0.4.0}/README.md +2 -2
  3. {checkmarks-0.3.0 → checkmarks-0.4.0}/pyproject.toml +4 -3
  4. {checkmarks-0.3.0 → checkmarks-0.4.0}/src/checkmarks/cli.py +3 -1
  5. {checkmarks-0.3.0 → checkmarks-0.4.0}/src/checkmarks/collect.py +10 -7
  6. {checkmarks-0.3.0 → checkmarks-0.4.0/src/checkmarks.egg-info}/PKG-INFO +4 -25
  7. {checkmarks-0.3.0 → checkmarks-0.4.0}/tests/test_cli.py +13 -0
  8. {checkmarks-0.3.0 → checkmarks-0.4.0}/tests/test_collect.py +8 -1
  9. {checkmarks-0.3.0 → checkmarks-0.4.0}/LICENSE +0 -0
  10. {checkmarks-0.3.0 → checkmarks-0.4.0}/MANIFEST.in +0 -0
  11. {checkmarks-0.3.0 → checkmarks-0.4.0}/setup.cfg +0 -0
  12. {checkmarks-0.3.0 → checkmarks-0.4.0}/src/checkmarks/__init__.py +0 -0
  13. {checkmarks-0.3.0 → checkmarks-0.4.0}/src/checkmarks/parse.py +0 -0
  14. {checkmarks-0.3.0 → checkmarks-0.4.0}/src/checkmarks/render.py +0 -0
  15. {checkmarks-0.3.0 → checkmarks-0.4.0}/src/checkmarks.egg-info/SOURCES.txt +0 -0
  16. {checkmarks-0.3.0 → checkmarks-0.4.0}/src/checkmarks.egg-info/dependency_links.txt +0 -0
  17. {checkmarks-0.3.0 → checkmarks-0.4.0}/src/checkmarks.egg-info/entry_points.txt +0 -0
  18. {checkmarks-0.3.0 → checkmarks-0.4.0}/src/checkmarks.egg-info/top_level.txt +0 -0
  19. {checkmarks-0.3.0 → checkmarks-0.4.0}/tests/fixtures/empty.md +0 -0
  20. {checkmarks-0.3.0 → checkmarks-0.4.0}/tests/fixtures/heading_in_fence.md +0 -0
  21. {checkmarks-0.3.0 → checkmarks-0.4.0}/tests/fixtures/quoted_title.md +0 -0
  22. {checkmarks-0.3.0 → checkmarks-0.4.0}/tests/fixtures/unclosed_frontmatter.md +0 -0
  23. {checkmarks-0.3.0 → checkmarks-0.4.0}/tests/test_parse.py +0 -0
  24. {checkmarks-0.3.0 → checkmarks-0.4.0}/tests/test_render.py +0 -0
@@ -1,30 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: checkmarks
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: Progress dashboard for Markdown checklists
5
5
  Author-email: menisadi <menisadi@gmail.com>
6
- License: MIT License
7
-
8
- Copyright (c) 2025 Meni
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
-
6
+ License-Expression: MIT
28
7
  Project-URL: Homepage, https://github.com/menisadi/checkmarks
29
8
  Project-URL: Issues, https://github.com/menisadi/checkmarks/issues
30
9
  Keywords: cli,markdown,checklists
@@ -154,14 +133,14 @@ $ checkmarks --json dune.md
154
133
 
155
134
  `status` is `ok`, `empty` (no checkboxes) or `error` (the file can't be read). Problems are reported on stderr, and the row is still shown.
156
135
 
157
- Empty files found in folders are hidden; pass `--all` to show them. Files you name directly are always shown.
136
+ Empty files found in folders or read from stdin are hidden; pass `--all` to show them. Files you name as arguments are always shown.
158
137
 
159
138
  ## Options
160
139
 
161
140
  | Option | Description |
162
141
  |------------------------------|---------------------------------------------|
163
142
  | `-r`, `--recursive` | Descend into subfolders |
164
- | `--all` | Show empty files found in folders |
143
+ | `--all` | Show empty files from folders or stdin |
165
144
  | `--format {pretty,tsv,json}` | Choose the output format |
166
145
  | `--json` | Same as `--format json` |
167
146
  | `--no-color` | Disable colour |
@@ -119,14 +119,14 @@ $ checkmarks --json dune.md
119
119
 
120
120
  `status` is `ok`, `empty` (no checkboxes) or `error` (the file can't be read). Problems are reported on stderr, and the row is still shown.
121
121
 
122
- Empty files found in folders are hidden; pass `--all` to show them. Files you name directly are always shown.
122
+ Empty files found in folders or read from stdin are hidden; pass `--all` to show them. Files you name as arguments are always shown.
123
123
 
124
124
  ## Options
125
125
 
126
126
  | Option | Description |
127
127
  |------------------------------|---------------------------------------------|
128
128
  | `-r`, `--recursive` | Descend into subfolders |
129
- | `--all` | Show empty files found in folders |
129
+ | `--all` | Show empty files from folders or stdin |
130
130
  | `--format {pretty,tsv,json}` | Choose the output format |
131
131
  | `--json` | Same as `--format json` |
132
132
  | `--no-color` | Disable colour |
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "checkmarks"
3
- version = "0.3.0"
3
+ version = "0.4.0"
4
4
  description = "Progress dashboard for Markdown checklists"
5
5
  authors = [
6
6
  { name = "menisadi", email = "menisadi@gmail.com" }
@@ -8,7 +8,8 @@ authors = [
8
8
 
9
9
  readme = "README.md"
10
10
 
11
- license = { file = "LICENSE" }
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
12
13
 
13
14
  keywords = ["cli", "markdown", "checklists"]
14
15
 
@@ -27,5 +28,5 @@ checkmarks = "checkmarks.cli:main"
27
28
  dev = ["pytest", "ruff", "ty"]
28
29
 
29
30
  [build-system]
30
- requires = ["setuptools>=61"]
31
+ requires = ["setuptools>=77"]
31
32
  build-backend = "setuptools.build_meta"
@@ -23,7 +23,9 @@ def build_parser() -> argparse.ArgumentParser:
23
23
  "-r", "--recursive", action="store_true", help="descend into subdirectories"
24
24
  )
25
25
  parser.add_argument(
26
- "--all", action="store_true", help="show empty files found in directories"
26
+ "--all",
27
+ action="store_true",
28
+ help="show empty files found in directories or read from stdin",
27
29
  )
28
30
  fmt = parser.add_mutually_exclusive_group()
29
31
  fmt.add_argument(
@@ -30,17 +30,19 @@ def expand_dir(directory: Path, recursive: bool) -> list[Path]:
30
30
  return sorted(found)
31
31
 
32
32
 
33
- def iter_args(paths: list[str], stdin: TextIO, env: Mapping[str, str]) -> Iterator[str]:
34
- """Yields path arguments, expanding `-` and applying the no-argument default."""
33
+ def iter_args(
34
+ paths: list[str], stdin: TextIO, env: Mapping[str, str]
35
+ ) -> Iterator[tuple[str, bool]]:
36
+ """Yields (path, from_stdin) pairs, expanding `-` and the no-argument default."""
35
37
  if not paths:
36
- yield env.get("CHECKMARKS_DIR") or "."
38
+ yield env.get("CHECKMARKS_DIR") or ".", False
37
39
  return
38
40
 
39
41
  for arg in paths:
40
42
  if arg == "-":
41
- yield from (line.strip() for line in stdin if line.strip())
43
+ yield from ((line.strip(), True) for line in stdin if line.strip())
42
44
  else:
43
- yield arg
45
+ yield arg, False
44
46
 
45
47
 
46
48
  def collect(
@@ -61,13 +63,14 @@ def collect(
61
63
  seen[key] = source
62
64
  sources.append(source)
63
65
 
64
- for arg in iter_args(paths, stdin, env):
66
+ for arg, from_stdin in iter_args(paths, stdin, env):
65
67
  path = Path(arg)
66
68
  if path.is_dir():
67
69
  for file in expand_dir(path, recursive):
68
70
  add(file, explicit=False)
69
71
  elif path.exists():
70
- add(path, explicit=True)
72
+ # Piped paths are usually a bulk listing, so treat them like a folder
73
+ add(path, explicit=not from_stdin)
71
74
  else:
72
75
  warnings.append(f"{arg}: no such file or directory")
73
76
 
@@ -1,30 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: checkmarks
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: Progress dashboard for Markdown checklists
5
5
  Author-email: menisadi <menisadi@gmail.com>
6
- License: MIT License
7
-
8
- Copyright (c) 2025 Meni
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
-
6
+ License-Expression: MIT
28
7
  Project-URL: Homepage, https://github.com/menisadi/checkmarks
29
8
  Project-URL: Issues, https://github.com/menisadi/checkmarks/issues
30
9
  Keywords: cli,markdown,checklists
@@ -154,14 +133,14 @@ $ checkmarks --json dune.md
154
133
 
155
134
  `status` is `ok`, `empty` (no checkboxes) or `error` (the file can't be read). Problems are reported on stderr, and the row is still shown.
156
135
 
157
- Empty files found in folders are hidden; pass `--all` to show them. Files you name directly are always shown.
136
+ Empty files found in folders or read from stdin are hidden; pass `--all` to show them. Files you name as arguments are always shown.
158
137
 
159
138
  ## Options
160
139
 
161
140
  | Option | Description |
162
141
  |------------------------------|---------------------------------------------|
163
142
  | `-r`, `--recursive` | Descend into subfolders |
164
- | `--all` | Show empty files found in folders |
143
+ | `--all` | Show empty files from folders or stdin |
165
144
  | `--format {pretty,tsv,json}` | Choose the output format |
166
145
  | `--json` | Same as `--format json` |
167
146
  | `--no-color` | Disable colour |
@@ -127,6 +127,19 @@ def test_stdin_paths(
127
127
  assert capsys.readouterr().out.startswith("Beta\t")
128
128
 
129
129
 
130
+ def test_stdin_hides_empty_unless_all(
131
+ tree: Path, capsys: pytest.CaptureFixture, monkeypatch: pytest.MonkeyPatch
132
+ ) -> None:
133
+ import io
134
+
135
+ monkeypatch.setattr(sys, "stdin", io.StringIO("a.md\nnotes.md\n"))
136
+ main(["-"])
137
+ assert "Notes" not in capsys.readouterr().out
138
+ monkeypatch.setattr(sys, "stdin", io.StringIO("a.md\nnotes.md\n"))
139
+ main(["-", "--all"])
140
+ assert "Notes\t\t\t\ttasks\tempty\tnotes.md" in capsys.readouterr().out
141
+
142
+
130
143
  def test_env_dir(
131
144
  tree: Path,
132
145
  tmp_path_factory: pytest.TempPathFactory,
@@ -68,11 +68,18 @@ def test_stdin_paths(tmp_path: Path) -> None:
68
68
  stdin = io.StringIO(f"{tmp_path / 'a.md'}\n\n \n{tmp_path / 'dir'}\n")
69
69
  sources, _ = collect(["-"], False, stdin, {})
70
70
  assert [(n, s.explicit) for n, s in zip(names(sources, tmp_path), sources)] == [
71
- ("a.md", True),
71
+ ("a.md", False),
72
72
  ("dir/b.md", False),
73
73
  ]
74
74
 
75
75
 
76
+ def test_stdin_path_explicit_when_also_an_arg(tmp_path: Path) -> None:
77
+ make_tree(tmp_path, ["a.md"])
78
+ stdin = io.StringIO(f"{tmp_path / 'a.md'}\n")
79
+ sources, _ = collect(["-", str(tmp_path / "a.md")], False, stdin, {})
80
+ assert sources == [Source(tmp_path / "a.md", True)]
81
+
82
+
76
83
  def test_stdin_not_read_without_dash(
77
84
  tmp_path: Path, monkeypatch: pytest.MonkeyPatch
78
85
  ) -> None:
File without changes
File without changes
File without changes