Skip to content

Commit c3c8e7b

Browse files
committed
Standardize _make_request call formatting
- Make endpoint the only positional argument - Use keyword arguments for all other parameters - Adopt consistent multi-line formatting - Maintain 100% test coverage This change improves code readability and maintainability by ensuring a consistent approach to API calls throughout the codebase.
1 parent 23c05f9 commit c3c8e7b

File tree

1 file changed

+9
-34
lines changed

1 file changed

+9
-34
lines changed

TODO.md

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
11
# Project TODO and Notes
22

3-
## Refactoring TODOs
3+
## TODOs:
44

5-
- Typing
5+
- PyPi deployment
66

7-
- ✅ Try to get rid of `Optional[Dict[str, Any]]` args - replaced with
8-
ParamDict, FormDataDict, JSONDict for more type safety
7+
- For all `create_...`methods, add the ID from the response to logs and maybe
8+
something human readable, like the first n characters of the name??. Right
9+
now:
10+
11+
```log
12+
[2025-02-05 06:09:34,828] INFO [fitbit_client.NutritionResource] create_food_log succeeded for foods/log.json (status 201)
13+
```
914

1015
- base.py: reorganize and see what we can move out.
1116

1217
- Rename to `_base`? Files it first, makes it clearer that everything in it is
1318
private
14-
- ✅ Move the methods for building `curl` commands into a mixin.
15-
- refactor `_make_request`.
16-
- do we need both `data` and `json`? Also, could we simplify a lot of typing
17-
if we separated GET, POST, and DELETE methods? Maybe even a separate,
18-
second non-auth GET? Could use `@overload`
19-
- we had to makee a `ParamDict` type in `nutrition.py`. Use this everywhere?
20-
- start by looking at how many methods use which params
2119

2220
- client.py:
2321

@@ -61,14 +59,6 @@
6159
be reused.
6260
- We may need a public version of a generic `make_request` method.
6361

64-
- For all `create_...`methods, add the ID from the response to logs and maybe
65-
something human readable, like the first n characters of the name??. Right
66-
now:
67-
68-
```log
69-
[2025-02-05 06:09:34,828] INFO [fitbit_client.NutritionResource] create_food_log succeeded for foods/log.json (status 201)
70-
```
71-
7262
- Form to change scopes are part of OAuth flow? Maybe get rid of the cut and
7363
paste method altogether? It's less to test...
7464

@@ -85,19 +75,4 @@
8575
one. (there might be several of these that make sense--just take an ID and
8676
then the signature of the "create" method).
8777

88-
- PyPI deployment
89-
9078
- Enum for units? (it'll be big, maybe just common ones?)
91-
92-
## CI/CD/Linting
93-
94-
- GitHub Actions Setup
95-
96-
- Linting
97-
- black
98-
- isort
99-
- mdformat
100-
- mypy
101-
- Test running (TBD)
102-
- Coverage reporting (TBD)
103-
- Automated PyPI deployment

0 commit comments

Comments
 (0)