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

Fixed errors before launch #6

Merged
merged 4 commits into from
Aug 3, 2024
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/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
pip install poetry
poetry install
- name: Run Ruff
run: poetry run ruff check
run: poetry run ruff check --output-format=github
check-typing:
runs-on: ${{ matrix.os }}
strategy:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ignori)
![GitHub License](https://img.shields.io/github/license/egamagz/ignori)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

Generate .gitignore file without leaving the terminal.
![Ignori screenshot](./assets/ignori_screenshoot.png "Ignori Screenshot")
Expand Down
4 changes: 2 additions & 2 deletions ignori/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from textual.widgets import Footer

from ignori.ignore_file import IgnoreFile
from ignori.util.settings import APP_TITLE, STYLES_PATH
from ignori.util.settings import APP_TITLE, STYLES
from ignori.widgets.generation_form import GenerationForm
from ignori.widgets.header import Header
from ignori.widgets.language_badge import LanguageBadge
Expand All @@ -17,7 +17,7 @@

class IgnoriApp(App[None], inherit_bindings=False):
TITLE = APP_TITLE
CSS_PATH = STYLES_PATH # type: ignore
CSS_PATH = STYLES # type: ignore

BINDINGS = [
Binding(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions ignori/util/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def __get_files(template_subpath: Path, categories: list[str]) -> list[IgnoreFil


def get_gitignore_templates(templates_path: Path = TEMPLATES_PATH) -> list[IgnoreFile]:
print(templates_path)
template_files: list[IgnoreFile] = []
current_categories: list[str] = []

Expand Down
7 changes: 7 additions & 0 deletions ignori/util/resources.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import importlib.resources as resources
from pathlib import Path


def get_path_from_resource_dir(dir_name: str) -> Path:
with resources.path("ignori", dir_name) as path:
return path
9 changes: 4 additions & 5 deletions ignori/util/settings.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
from importlib.metadata import version
from pathlib import Path

BASE_DIR = Path(__file__).resolve().parent.parent.parent
from ignori.util.resources import get_path_from_resource_dir

STYLES_DIR = BASE_DIR / "styles"
STYLES_DIR = get_path_from_resource_dir("styles")

STYLES_PATH = [
STYLES = [
STYLES_DIR / "global.tcss",
STYLES_DIR / "widgets.tcss",
STYLES_DIR / "modals.tcss",
]

TEMPLATES_PATH = BASE_DIR / "templates"
TEMPLATES_PATH = get_path_from_resource_dir("templates")

APP_TITLE = "Ignori"

Expand Down
40 changes: 20 additions & 20 deletions poetry.lock

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

13 changes: 7 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ignori"
version = "1.0.2"
version = "1.0.4"
description = "Generate .gitignore file without leaving the terminal."
authors = ["Gamaliel Garcia <[email protected]>"]
maintainers = ["Gamaliel Garcia <[email protected]>"]
Expand Down Expand Up @@ -31,9 +31,11 @@ classifiers = [
"Topic :: Software Development :: Version Control :: Git",
"Typing :: Typed",
]

exclude = ["tests", "CONTRIBUTING.md"]
include = ["LICENSE", "styles", "templates", "README.md", "assets"]
include = [
"LICENSE",
"README.md",
]


[tool.poetry.dependencies]
Expand All @@ -49,7 +51,7 @@ ignori = "ignori.app:main"

[tool.poetry.group.dev.dependencies]
textual-dev = "^1.5.1"
ruff = "^0.5.4"
ruff = "^0.5.6"
mypy = "^1.10.0"
ruff-lsp = "^0.0.54"

Expand Down Expand Up @@ -91,8 +93,7 @@ select = [
"PTH",
"I",
]
ignore = []

ignore = ["COM812"]
fixable = ["ALL"]

[tool.ruff.format]
Expand Down
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import pytest

from ignori.util.settings import TEMPLATES_PATH


@pytest.fixture
def data_dir() -> Path:
Expand All @@ -11,8 +13,7 @@ def data_dir() -> Path:

@pytest.fixture
def templates_dir() -> Path:
test_dir = Path(__file__)
return test_dir.parent.parent / "templates"
return TEMPLATES_PATH


@pytest.fixture(scope="module")
Expand Down
Loading