Skip to content

Commit 6d3e6bf

Browse files
Update 482-pre-commit-hooks-for-python-devs.txt
1 parent fd51d1c commit 6d3e6bf

File tree

1 file changed

+26
-27
lines changed

1 file changed

+26
-27
lines changed

transcripts/482-pre-commit-hooks-for-python-devs.txt

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
00:00:08 tired of dealing with tons of conflicts and spurious Git changes? You need Git pre-commit
66

7-
00:00:13 hooks. Well, we're lucky to have Stephanie Molin on the show today, who has done a bunch of writing
7+
00:00:13 hooks. Well, we're lucky to have Stefanie Molin on the show today, who has done a bunch of writing
88

99
00:00:18 and teaching of Git hooks. This is Talk Python to Me, episode 482, recorded October 24th, 2024.
1010

@@ -28,9 +28,9 @@
2828

2929
00:01:19 brought to you by Bluehost. Do you need a website fast? Get Bluehost. Their AI builds your WordPress site
3030

31-
00:01:25 in minutes, and their built-in tools optimize your growth. Don't wait. Visit talkpython.fm
31+
00:01:25 in minutes, and their built-in tools optimize your growth. Don't wait. Visit talkpython.fm/ Bluehost
3232

33-
00:01:31 slash Bluehost to get started. Hey, everyone. Before we jump into the interview with Stephanie,
33+
00:01:31 to get started. Hey, everyone. Before we jump into the interview with Stefanie,
3434

3535
00:01:36 I want to tell you real quickly that I just released a blog for Talk Python. Now, we have had tons of RSS
3636

@@ -42,15 +42,15 @@
4242

4343
00:02:01 really cool things on there. I've already got a couple of articles posted, but I have plans for
4444

45-
00:02:06 some interesting series. And anytime there's some more interesting announcements or exciting news I
45+
00:02:06 some interesting series. And anytime there's some more interesting announcements or exciting news
4646

47-
00:02:11 want to share with Talk Python, it's going to be over on the Talk Python blog. So if you're interested,
47+
00:02:11 I want to share with Talk Python, it's going to be over on the Talk Python blog. So if you're interested,
4848

4949
00:02:16 I would really, really appreciate it. If you go to talkpython.fm, click on blog, right in the
5050

5151
00:02:21 navigation or at the bottom and just subscribe to the RSS feed. That way we can stay in touch.
5252

53-
00:02:26 And with that, let's talk pre-commit hooks. Stephanie, welcome to Talk Python. It's awesome
53+
00:02:26 And with that, let's talk pre-commit hooks. Stefanie, welcome to Talk Python. It's awesome
5454

5555
00:02:32 to have you. Thanks for having me. Yeah, really looking forward to talking about pre-commit hooks.
5656

@@ -360,7 +360,7 @@
360360

361361
00:15:46 Sentry. Create your Sentry account now at talkpython.fm/Sentry. And if you sign up with the code
362362

363-
00:15:52 talkpython, all capital, no spaces, it's good for two free months of Sentry's business plan, which will give you up to
363+
00:15:52 TALKPYTHON, all capital, no spaces, it's good for two free months of Sentry's business plan, which will give you up to
364364

365365
00:16:00 20 times as many monthly events as well as other features.
366366

@@ -486,15 +486,15 @@
486486

487487
00:20:47 So this next one is pretty interesting that we're adding here in this example, and that's the rough pre-commit from straight from Astral, right?
488488

489-
00:20:57 So this is just github.com slash astral.sh, which is the company behind rough newbie.
489+
00:20:57 So this is just github.com/astral.sh, which is the company behind rough newbie.
490490

491491
00:21:02 And this is the rough pre-commit.
492492

493493
00:21:04 But what's interesting about this is, well, one, that it has nothing to do with the pre-commit project.
494494

495495
00:21:09 But two, that this one also takes special arguments that you can pass to it.
496496

497-
00:21:14 Yeah, so I think the rough pre-commit one is just a smaller version so that it works faster with pre-commit.
497+
00:21:14 Yeah, so I think the ruff pre-commit one is just a smaller version so that it works faster with pre-commit.
498498

499499
00:21:20 Because pre-commit will have to install these at some point.
500500

@@ -524,7 +524,7 @@
524524

525525
00:22:06 So you can use the args here to provide stuff that you only want to happen when it's running in the context of pre-commit.
526526

527-
00:22:14 Yeah, and rough has a exit non-zero on fix, which means if it goes through and you say to fix it, it will fix it.
527+
00:22:14 Yeah, and ruff has a exit non-zero on fix, which means if it goes through and you say to fix it, it will fix it.
528528

529529
00:22:21 But then it'll error out and say that wasn't a smooth transition or whatever, which is cool because that will then fail the commit itself.
530530

@@ -592,11 +592,11 @@
592592

593593
00:23:53 and then it takes these arguments, I think this is an interesting point of discussion.
594594

595-
00:23:57 So the example you have in your article just says, what we're going to tell rough is dash,
595+
00:23:57 So the example you have in your article just says, what we're going to tell ruff is dash,
596596

597597
00:24:01 dash, fix, dash, dash, exit non-zero fix, and show fixes, which is all good.
598598

599-
00:24:07 But rough can be pretty complex in its configuration, right?
599+
00:24:07 But ruff can be pretty complex in its configuration, right?
600600

601601
00:24:11 You can say, disable flight gate, turn this one on.
602602

@@ -608,7 +608,7 @@
608608

609609
00:24:21 So you can either do this argument thing, or if it's supported, you could also potentially have,
610610

611-
00:24:27 say, a rough.toml, right?
611+
00:24:27 say, a ruff.toml, right?
612612

613613
00:24:28 Yeah.
614614

@@ -618,7 +618,7 @@
618618

619619
00:24:38 Yeah, exactly.
620620

621-
00:24:38 So you just add a rough section in there and then you configure things.
621+
00:24:38 So you just add a ruff section in there and then you configure things.
622622

623623
00:24:42 And this is stuff that you'd want to use both in your editor as well as in the pre-commit stage,
624624

@@ -640,7 +640,7 @@
640640

641641
00:25:01 No, no, you don't.
642642

643-
00:25:02 So I suppose that's a massive bonus of having either the tool.rough settings in your pyproject or just a rough.toml,
643+
00:25:02 So I suppose that's a massive bonus of having either the tool.rough settings in your pyproject or just a ruff.toml,
644644

645645
00:25:09 however you go about that, it doesn't really matter.
646646

@@ -782,17 +782,17 @@
782782

783783
00:28:30 a certain standard.
784784

785-
00:28:30 I think one of them is called committizen.
785+
00:28:30 I think one of them is called commitizen.
786786

787787
00:28:32 And so that runs on, my guess is on the commit message hook.
788788

789-
00:28:36 Committizen?
789+
00:28:36 Commitizen?
790790

791791
00:28:37 Yes.
792792

793793
00:28:38 Okay.
794794

795-
00:28:38 What is this committizen about?
795+
00:28:38 What is this commitizen about?
796796

797797
00:28:39 I haven't heard of this.
798798

@@ -1524,11 +1524,11 @@
15241524

15251525
00:45:18 And I will be talking about Datamorph once again.
15261526

1527-
00:45:21 And I'm hoping to run my third development sprint on Datamorph while I'm there.
1527+
00:45:21 And I'm hoping to run my third development sprint on Data Morph while I'm there.
15281528

15291529
00:45:26 Oh, that's cool.
15301530

1531-
00:45:27 Yeah, we'll talk about Datamorph in a second.
1531+
00:45:27 Yeah, we'll talk about Data Morph in a second.
15321532

15331533
00:45:28 That's some interesting stuff.
15341534

@@ -1782,7 +1782,7 @@
17821782

17831783
00:51:11 example, pip to install this.
17841784

1785-
00:51:12 And if you have, for example, pyproject.tomo and you specify how it should be built, then
1785+
00:51:12 And if you have, for example, pyproject.toml and you specify how it should be built, then
17861786

17871787
00:51:16 all of that just happens as it normally would.
17881788

@@ -1856,7 +1856,7 @@
18561856

18571857
00:52:36 And that's also a quicker way to get started versus trying to, let's say, read the pipe,
18581858

1859-
00:52:42 find the pipe project.tongle, read it in, parse out things.
1859+
00:52:42 find the pyproject.toml, read it in, parse out things.
18601860

18611861
00:52:46 That's all stuff that can come later once you figure out exactly how you want your tool to
18621862

@@ -1890,13 +1890,13 @@
18901890

18911891
00:53:31 You can click, you can type, but if you want something built in, yeah, if you want something
18921892

1893-
00:53:37 built in, argpars is pretty straightforward, right?
1893+
00:53:37 built in, argparse is pretty straightforward, right?
18941894

18951895
00:53:39 Yeah.
18961896

18971897
00:53:40 And I think also, I mean, if you look at the pre-commit hooks repo provided by pre-commit org,
18981898

1899-
00:53:45 a lot of them, or maybe all of them are just using argpars.
1899+
00:53:45 a lot of them, or maybe all of them are just using argparse.
19001900

19011901
00:53:49 Because for most hooks, all you'll need to say is, I have an argument parser and it accepts
19021902

@@ -2512,7 +2512,7 @@
25122512

25132513
01:07:51 All right.
25142514

2515-
01:07:52 Well, Stephanie, thank you so much for being here.
2515+
01:07:52 Well, Stefanie, thank you so much for being here.
25162516

25172517
01:07:54 Let's wrap things up.
25182518

@@ -2594,7 +2594,7 @@
25942594

25952595
01:09:30 We should be right at the top.
25962596

2597-
01:09:31 You can also find the iTunes feed at /itunes, the Google Play feed at /play,
2597+
01:09:31 You can also find the iTunes feed at /iTunes, the Google Play feed at /play,
25982598

25992599
01:09:36 and the direct RSS feed at /rss on talkpython.fm.
26002600

@@ -2613,4 +2613,3 @@
26132613
01:09:56 Now get out there and write some Python code.
26142614

26152615
01:09:57 I'll see you next time.
2616-

0 commit comments

Comments
 (0)