Мы используем Makefile думая, что нет альтернатив, что это стандарт и всё такое.
Но make это не запускалка команд, а система сборки. Мы фактически используем его не по назначению.
И на самом деле альтернатива есть! Некоторое время назад я открыл для себя прекрасный инструмент - just. Он решает все проблемы make.
just - это не система сборки как make, это именно исполнитель команд!
Больше никаких Phony Targets и табуляций, привет нормальный синтаксис и передача аргументов!!! 😎
⭐️Что умеет just:
✅ Автодокументирование команд
Не нужно делать отдельную команду с докой, просто добавь комментарий
# команда сборки
build:
...
$ just --list
Available recipes:
build # команда сборки
Команда с именем default запускается по умолчанию если не указано другое, так что я обычно делаю так:
default:
just --list
Теперь просто выполняем just и получаем доку из текущего файла.
✅ Удобная работа с переменными окружения
# загрузить из .env
set dotenv-load
# глобальная переменная
export PYTHONPATH := "./src"
# переменная для команды
test $TESTUNG="true":
pytest
✅ Передача аргументов
build target:
@echo 'Build {{target}}...'
команда запуска
$ just build dev
# Build dev...
✅ Выбор интерпретатора прямо в команде
Пример с инлайн-скриптом на python:
system:
#!/usr/bin/env python3
import platform
print(platform.system())
Эта же функция позволит выполнить скрипт как одну команду вместо перезапуска шела для каждой строки
foo:
#!/usr/bin/env sh
for file in ls .; do
echo $file
done
✅ Выполнение команды в определенной директории. Можно указать как релятивный путь так и абсолютный
[working-directory: 'backend']
build:
docker compose build
Также можно задать рабочую директорию глобально
Там еще много интересного:
- поддержка функций
- автокомплиты и интеграции
- экспрешены
- алиасы команд
- группировка команд
- альтернативы команды под разные ОС
- импорт других just-файлов
- цветной вывод
- ... и другие штуковины!
Так что вперёд - ➡️ читать доку!
Репозиторий: ➡️https://github.com/casey/just
Статья: ➡️https://www.chicks.net/reference/file_formats/just/
ЗЫ. Кажется, на Makefile я уже не вернусь)
#tools
😄Pretty
➖➖➖➖➖➖
🔘Pretty as an adjective means 'attractive, especially when talking about girls or women'.
Margo always tells her daughter that she's pretty.Margo always tells her daughter that she's pretty.
🔜Jacob's mum is really pretty.
🔘Pretty is also used to talk about things that are 'pleasant to look at in a delicate or charming way'. While this is often connected to females, it can also be used to describe something like 'a view'.
🔜There's a very pretty view at the top of that hill.
🔜My friend moved out of the city and bought a pretty cottage in the countryside.
🔘As an adverb, pretty can be an informal way of saying 'quite' or 'rather'.
🔜The house was built recently, it's pretty new.
🔜I enjoyed that film, it was pretty good.
🔘We can also use pretty to give emphasis.
🔜We went to bed at 2am, so we were pretty tired.
🔜I'm pretty angry right now, so don't talk to me.
#Pretty👨🏫@America
➖➖➖➖➖➖➖➖➖➖➖➖
🆕 Crypto News @Money
😁 Crypto Game @Egame
🇺🇸 US News @America
🇯🇵 Japan News @Japan
🇦🇪 UAE News @Dubai
▶️ Popular Movies @Videos
😜 Best Funny Video @Funnys
😄Pretty
➖➖➖➖➖➖
🔘Pretty as an adjective means 'attractive, especially when talking about girls or women'.
Margo always tells her daughter that she's pretty.Margo always tells her daughter that she's pretty.
🔜Jacob's mum is really pretty.
🔘Pretty is also used to talk about things that are 'pleasant to look at in a delicate or charming way'. While this is often connected to females, it can also be used to describe something like 'a view'.
🔜There's a very pretty view at the top of that hill.
🔜My friend moved out of the city and bought a pretty cottage in the countryside.
🔘As an adverb, pretty can be an informal way of saying 'quite' or 'rather'.
🔜The house was built recently, it's pretty new.
🔜I enjoyed that film, it was pretty good.
🔘We can also use pretty to give emphasis.
🔜We went to bed at 2am, so we were pretty tired.
🔜I'm pretty angry right now, so don't talk to me.
#Pretty👨🏫@America
➖➖➖➖➖➖➖➖➖➖➖➖
🆕 Crypto News @Money
😁 Crypto Game @Egame
🇺🇸 US News @America
🇯🇵 Japan News @Japan
🇦🇪 UAE News @Dubai
▶️ Popular Movies @Videos
😜 Best Funny Video @Funnys
http://www.enlistq.com/10-python-idioms-to-help-you-improve-your-code/
If you have ever tried to learn a new language (not a programming language), you know that we always think in our native language before we translate it to the new language. This can lead to you forming some sentences that don’t make sense in the new language but are perfectly normal in your native language. For example, in a lot of languages, you ‘open’ an electronic gadget such as fan, AC or cell phone. When you say that in English, it means to literally open the gadget instead of turning it on.
The same is true for programming languages. As we pick up new languages, such as #python, we are using our prior knowledge of programming in another language (q, java, c++ etc) and translating that to python. Many times, your code will work but it won’t be ‘#pretty’ or #fast. In python terms, your code won’t be ‘#pythonic’.