Тёмный
No video :(

The Ruff formatter is 130x FASTER than Black 

Carberra
Подписаться 19 тыс.
Просмотров 7 тыс.
50% 1

First they come for the linters, then they come for the formatters... Who will they go for next?!
-
If you enjoy my content, consider supporting me on Patreon or becoming a member!
patreon.carber...
join.carberra.xyz
If you need help with anything, feel free to join the Discord server:
discord.carber...
I get a lot of people asking, so here's my Visual Studio Code setup!
• My Visual Studio Code ...
-
If you have any questions, don't hesitate to ask in the comments! I'll try and answer as soon as I can, providing someone else hasn't already done so.
#python #coding #howto

Опубликовано:

 

20 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 30   
@Chris-rm1pn
@Chris-rm1pn 9 месяцев назад
It also can replace isort
@desertfish74
@desertfish74 6 месяцев назад
All the files scanned after the tensorflow scan, will then likely be in the file system cache. Running black a second time, will probably be quite a bit faster as well.
@yorailevi6747
@yorailevi6747 9 месяцев назад
Thanks for showing the diff, I always hated that multi line aspect of black, i will definitely use ruff regardless of the performance
@MangoNutella
@MangoNutella 9 месяцев назад
You can, however, tell black to ignore single/double quotes so that single quotation is possible.
@user-ct9oz8nc1p
@user-ct9oz8nc1p 2 месяца назад
Hi! Thanks for the video! What color scheme do you use for the code?
@Carberra
@Carberra 2 месяца назад
Glad you enjoyed it! Setup info is in the description.
@JustLikeBuildingThings
@JustLikeBuildingThings 9 месяцев назад
Thanks for the video, looks like it the pywin32 dependency doesn't work on py 3.11 at the moment so non starter for me! Looks good though, especially the annoying splitting black does sometimes over too many lines.
@mecrayavcin
@mecrayavcin Месяц назад
I have a black formatter problem can i send you s short video. I dont like its formating. It takes if conditions inside () and also inside it it creates bew line it messed up my codes
@Salah-YT
@Salah-YT 9 месяцев назад
Hi, I'm a beginner to Python and I followed the course is about 9 hours but I downloaded Python 3.12 and I have a Python extension and I tried Autopep and Black Formatter but none worked and even chatGPT couldn't help very well so can you make a video step by step for python 3.12 how we format easily for a beginner I mean type code everywhere but when I save it I like formatting like Prettier do for javascript ok you know what I mean thank you so much
@Carberra
@Carberra 9 месяцев назад
I have a video on the Black formatter, as well as how to format on save in VS Code. Black doesn't work any differently for 3.12.
@Salah-YT
@Salah-YT 9 месяцев назад
​@@Carberra Thanks, bro! I watched your video at ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-QU3lxjJ0Kbo.html, but unfortunately, it's not working for me. I have Black Formatter, but when I downloaded Black and isort, I encountered this error: 'Connection to server got closed. Server will not be restarted.' I think this might be the reason I can't format on save. I couldn't find any videos or articles addressing this issue, and even ChatGPT couldn't help me. I suspect these extensions might not be compatible with Python 3.12. I'm following a Python course, and at the beginning, the instructor only covered Python extensions, and he could format the code. However, he was using Python 3.11. It seems like there aren't many resources for Python 3.12 at the moment. Since I've done many courses on JS, HTML, CSS, React, and NextJS, I'm eager to learn Python. But this formatting issue has been a roadblock for me. I'm used to formatting on save, similar to how I do it in JS. I've been searching for a solution for a while, but if you could help me out, that would be great, bro! Thank you so much.
@Carberra
@Carberra 9 месяцев назад
Hm, I'm not sure how much I can help because I use 3.12 and it all works fine for me 😅 Try uninstalling and reinstalling Python 3.12 (or destroying and recreating your venv if you're using one), and seeing if that makes a difference. It may also be worth disabling and re-enabling those extensions as well.
@Gh0sTG0
@Gh0sTG0 9 месяцев назад
Hi. Is there any chance on doing video like "using ruff with pycharm"? Tried vscode, but for programming for me pycharm looks much more... comfortable...
@ultrasound1459
@ultrasound1459 9 месяцев назад
No, no one is using pycharm
@Carberra
@Carberra 9 месяцев назад
I've never used PyCharm so I don't know how much support is there for it. You could use it on the command line if you don't care about format-on-save or anything like that.
@Gh0sTG0
@Gh0sTG0 9 месяцев назад
@@Carberra Aha, ok. TY for answer.
@khanra17
@khanra17 9 месяцев назад
@@ultrasound1459 You are not everyone kiddo groww up.
@legion_prex3650
@legion_prex3650 9 месяцев назад
pycharm is shit. I have to use it right now and it is kinda slow and i hate it.
@hereallyfast
@hereallyfast 9 месяцев назад
What do you think about trunk?
@Carberra
@Carberra 9 месяцев назад
I'm not sure I understand?
@anamoyeee
@anamoyeee 9 месяцев назад
Is it possible to set the formatter to use 2-space indentation?
@Carberra
@Carberra 9 месяцев назад
Looks like you can set `indent-width` in the global configuration settings.
@anamoyeee
@anamoyeee 9 месяцев назад
@@Carberra That worked, thanks! Also may i ask if it's possible to make it run on file save?
@Carberra
@Carberra 9 месяцев назад
I've got a video about formatting on save in VS Code. It's for Black, but it's an easy configuration change. You'll likely need to check the extension README (or somewhere in the docs).
@workflowinmind
@workflowinmind 9 месяцев назад
Did they reach 1.0? Pip installs 0.1.4
@Carberra
@Carberra 9 месяцев назад
They reached 0.1. I may have misspoke, I don't remember.
@helish_88
@helish_88 9 месяцев назад
I miss your hairs 😢
Далее
Unit testing Python code using Pytest + GitHub Actions
23:02
Why Python is the Perfect First Language to Learn
0:40
PEDRO PEDRO INSIDEOUT
00:10
Просмотров 803 тыс.
Never Troll Shelly🫡 | Brawl Stars
00:10
Просмотров 685 тыс.
I Trained an AI with 10,000 Memes
14:52
Просмотров 283 тыс.
The Clever Way to Count Tanks - Numberphile
16:45
Просмотров 986 тыс.
Compilers, How They Work, And Writing Them From Scratch
23:53
Deques can be FASTER than lists in Python
12:17
Просмотров 26 тыс.
Your Python code NEEDS these 5 EASY optimisations
14:22
Ruff is the FUTURE of Python development
14:25
Просмотров 132 тыс.
Ruff is a Game Changer for your Python Code!
15:10
Просмотров 1,7 тыс.