Skip to content

Commit

Permalink
fix: ci formatter.
Browse files Browse the repository at this point in the history
  • Loading branch information
codito committed Jan 13, 2024
1 parent 5697bec commit e41f02f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
pip freeze
- name: Lint with ruff
run: |
ruff
ruff check
- name: Test with pytest
run: |
pytest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
pip freeze
- name: Lint with ruff
run: |
ruff
ruff check
- name: Test with pytest
run: |
pytest
26 changes: 24 additions & 2 deletions habito/commands/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import shutil
from datetime import datetime, timedelta
from typing import Literal, Union

import click

Expand All @@ -26,11 +27,28 @@
default="table",
help="Output format. Default is table.",
)
def list(long_list, format="table"):
@click.option(
"-d",
"--duration",
type=click.STRING,
default="1 week",
help=(
"Duration for the report. Default is 1 week. "
"Use `all` to dump all activities since beginning. "
"If format is table, maximum duration is inferred "
"from the terminal width."
),
)
def list(
long_list: bool,
format: Union[Literal["csv"], Literal["table"]] = "table",
duration="1 week",
):
"""List all tracked habits."""
from terminaltables import SingleTable
from textwrap import wrap

from terminaltables import SingleTable

terminal_width, terminal_height = shutil.get_terminal_size()

nr_of_dates = terminal_width // 10 - 4
Expand Down Expand Up @@ -86,3 +104,7 @@ def list(long_list, format="table"):
r[0] = "\n".join(wrap(r[0], max_col_width))

click.echo(table.table)


# def _get_max_duration(format: str, duration: str) -> int:
# return 0
5 changes: 0 additions & 5 deletions renovate.json

This file was deleted.

0 comments on commit e41f02f

Please sign in to comment.