/okrutnik

Bash script that helps you write correct Python code

Primary LanguageShellGNU General Public License v3.0GPL-3.0

Okrutnik

linux Python License: GPL v3 okrutnik CodeFactor

Okrutnik (/ɔkrutɲik/) - a bash script that helps you write correct Python code.

It can also ruin your day by letting you know how much your code sucks.

So like... enjoy.

o2

📦 Deps

It uses a bundle of different linters and a code formatter:

bandit | black | codespell | mypy | pylama | pylint | pyright | ruff

💾 Installation

Download

wget https://raw.githubusercontent.com/c0m4r/okrutnik/main/okrutnik.sh
chmod +x okrutnik.sh

Just put it where your project is and install the required modules:

./okrutnik.sh --install

Include custom modules used in your project with -r requirements.txt:

./okrutnik.sh --install -r requirements.txt

Okrutnik will create a virtual Python environment in .okrutnik_venv for itself and store its tools in order to perform a scan.

You can --update or --uninstall them at any time.

🚀 Usage

./okrutnik.sh target.py

To stop on failed linters or errors:

./okrutnik.sh --stop target.py

Be advised: it will reformat your code by default. Make a backup or comment out black before use.

Usage: ./okrutnik.sh [options] <target>

Before <target>:
 -s, --stop       Exit on failed linters or errors

Standalone:
 -h, --help       Print this help message
 --update         Update installed tools
 --uninstall      Remove installed tools
 --safety         Run safety check

📜 License

Okrutnik: a bash script that helps you write correct Python code
Copyright (C) 2024 c0m4r

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see https://www.gnu.org/licenses/.

💸 Funding

If you found this script helpful, please consider making a donation to a charity on my behalf. Thank you.