Skip to content

Commit

Permalink
chore(linter): replace black with ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
catcombo committed Nov 23, 2024
1 parent 80f39b8 commit 3560a91
Show file tree
Hide file tree
Showing 12 changed files with 128 additions and 434 deletions.
28 changes: 10 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,21 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.7

- name: Install Poetry
run: |
pip install poetry
poetry config virtualenvs.path ~/.cache/pypoetry/virtualenvs
- run: pipx install poetry

- name: Restore virtualenv from cache
id: cache
uses: actions/cache@v4
- uses: actions/setup-python@v5
with:
path: ~/.cache/pypoetry/virtualenvs
key: poetry-${{ hashFiles('poetry.lock') }}
python-version: '3.7'
cache: poetry

- run: poetry install --no-root

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: poetry install

- name: Run linter
run: poetry run flake8
- run: poetry run ruff check

- run: poetry run ruff format --diff

- name: Run tests
run: poetry run pytest
- run: poetry run pytest
16 changes: 8 additions & 8 deletions .idea/watcherTasks.xml

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

2 changes: 1 addition & 1 deletion jira2markdown/markup/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def __init__(self, inline_markup: Forward, markup: Forward, usernames: dict):
self.inline_markup = inline_markup
self.markup = markup
self.usernames = usernames
self.init_kwargs = dict(inline_markup=inline_markup, markup=markup, usernames=usernames)
self.init_kwargs = {"inline_markup": inline_markup, "markup": markup, "usernames": usernames}

@property
def expr(self) -> ParserElement:
Expand Down
9 changes: 1 addition & 8 deletions jira2markdown/markup/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,7 @@ def action(self, tokens: ParseResults) -> str:
# Converts multiline text to one line,
# because markdown doesn't support multiline text in table cells
output = [
"|"
+ "|".join(
map(
lambda cell: cell.replace("\n", "<br>"),
map(self.markup.transform_string, row),
),
)
+ "|"
"|" + "|".join(self.markup.transform_string(cell).replace("\n", "<br>") for cell in row) + "|"
for row in lines
]

Expand Down
Loading

0 comments on commit 3560a91

Please sign in to comment.