Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Condition Analyze & Refactor #247

Merged
merged 10 commits into from
Sep 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ jobs:
run: |
git config --local user.email "hakancelikdev@gmail.com"
git config --local user.name "Hakan Celik"
git fetch --all
git fetch --all
mkdocs gh-deploy -m "Update Docs" --remote-branch gh-pages
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ repos:
rev: 0.11.3
hooks:
- id: unimport
args: [--config=pyproject.toml]

- repo: https://github.com/PyCQA/docformatter
rev: v1.5.0
hooks:
- id: docformatter
args: [--config=pyproject.toml]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
Expand All @@ -40,7 +42,7 @@ repos:
files: "\\.(py|.txt|.yaml|.json|.in|.md|.toml|.cfg|.html|.yml)$"

- repo: https://github.com/asottile/pyupgrade
rev: v2.37.3
rev: v2.38.0
hooks:
- id: pyupgrade
args: [--py36-plus]
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ COPY . /app
WORKDIR /app

RUN apk add cargo \
&& pip install --upgrade pip \
&& pip install .
&& pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir .

ENTRYPOINT ["python", "-m", "unimport"]
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:
runs:
using: "composite"
steps:
- run: pip install --upgrade pip && python -m pip install unimport==0.11.3
- run: pip install --upgrade pip && python -m pip install unimport==0.12.0
shell: bash
- run: unimport --color auto --gitignore --ignore-init ${{ inputs.extra_args }}
shell: bash
Expand Down
288 changes: 159 additions & 129 deletions docs/CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
# Tools

[tool.pytest.ini_options]
addopts = "-v -x"
addopts = "-v"
xfail_strict = true
testpaths = ["tests"]

Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ zip_safe = true
packages =
unimport
unimport.commands
unimport.analyzers
package_dir =
=src
install_requires =
Expand Down
2 changes: 1 addition & 1 deletion src/unimport/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "0.11.3"
__version__ = "0.12.0"
__description__ = "A linter, formatter for finding and removing unused import statements."
9 changes: 5 additions & 4 deletions src/unimport/__main__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
def main():
from unimport import color, emoji
from unimport.color import paint
from unimport.enums import Color, Emoji
from unimport.main import Main

main = Main.run()
if not main.is_unused_imports and main.config.check:
print(
color.paint(
f"{emoji.STAR} Congratulations there is no unused import in your project. {emoji.STAR}",
color.GREEN,
paint(
f"{Emoji.STAR} Congratulations there is no unused import in your project. {Emoji.STAR}",
Color.GREEN,
main.config.use_color,
)
)
Expand Down
Loading