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

Add a new tool 'pre-commit' for the development mode #13

Merged
merged 7 commits into from
May 3, 2024

Conversation

BIXBER
Copy link
Contributor

@BIXBER BIXBER commented Apr 28, 2024

К проекту был добавлен новый инструмент, позволяющий производить полезные действия перед записью изменений в рабочую ветку разработчика.

Такая возможность позволяет:

  1. Указывать на ошибки в коде Python;
  2. Форматировать код Python для приведения его к единому стилю;
  3. Проверять, что изменения добавляются в безопасную ветку.

Для пользования данным инструментом, необходимо в активированном виртуальном окружении выполнить команду установки всех зависимостей:

poetry install

И выполнить установку всех hook'ов из удаленных репозиториев, одноразово выполнив команду:

pre-commit install

Также был обновлен файл конфигурации 'pyproject.toml', где были добавлены и разделены зависимости по режимам запуска проекта (разработка и продакшн); был добавлен файл конфигурации инструмента ruff, который выполняет форматирование и линтинг исходного кода Python.

ruff.toml Outdated
@@ -0,0 +1,18 @@
target-version = "py312"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нам обязательно отдельный конфигуратор для ruff такой создавать?
Посмотри пожалуйста на ПР #15 Если мы всё укажем в pyproject.toml?
Если же нет, то давай примерно одинаковую конфигурацию сделаем и для poetry и pre-commit

@KonstantinRaikhert KonstantinRaikhert linked an issue May 1, 2024 that may be closed by this pull request
Copy link
Member

@KonstantinRaikhert KonstantinRaikhert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Посмотри пожалуйста на конфигурацию в poetry

@KonstantinRaikhert
Copy link
Member

@BIXBER Еще есть конфликты в pyproject.toml

@BIXBER
Copy link
Contributor Author

BIXBER commented May 3, 2024

Пересмотрел свое решение касаемо выноса ruff в отдельный файл и перенес все недостающие конфиг-лайны в pyproject.toml. Решил все git-conflict'ы.

Copy link
Member

@KonstantinRaikhert KonstantinRaikhert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отлично! Мержим

@KonstantinRaikhert KonstantinRaikhert merged commit d2939a5 into dev May 3, 2024
@BIXBER BIXBER self-assigned this May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Добавить инструмент pre-commit
2 participants