쉐도잉 연습: The easy way to keep your repos tidy. - 영상으로 영어 말하기 배우기

연습 모드 선택

각 모드는 전체 화면 연습실로 열립니다.

78 문장
문장이 너무 짧거나 길면 Edit를 눌러 조정하세요.
1
Hello and welcome.
2
I'm James Murphy and today we're talking about PreCommit, which is a really cool tool that you can use to keep your codebase tidy
3
and catch some simple mistakes before things ever get committed into Git.
4
It happens.
5
There's a new person on your team that doesn't really know about PEP8, or you just forget to run your code formatter, or you just make a typo in a config file somewhere.
6
But at the time, you don't really notice, so you just go ahead and git commit.
7
Then either something breaks, or just the quality of your codebase has gone down just a little bit.
8
Well, a bad config you can fix, and code you can just reformat.
9
But still, wouldn't it be better if you could just catch those errors before the commit happens?
10
That's what pre-commit is for.
11
Here's the story of pre-commit.
12
Basically, git has a notion of what are called commit hooks.
13
These are things that happen either before you commit or just after you commit or when you push or when you pull, things like that.
14
Git will store this and a whole bunch of other information in the .git folder inside a directory.
15
Depending on your editor, this folder might be hidden, so just look out for that.
16
You might have to unhide it.
17
This hooks folder is where git stores all these different hooks.
18
The ones you see here are just samples.
19
If you were to get rid of that .sample on the end of the file name, then git would actually run that action at that corresponding So if I have a file named pre-commit,
20
then Git will run that script right before a commit happens.
21
But you don't need to go out and waste your time writing something like this yourself.
22
A lot of really good scripts have already been written.
23
The pre-commit project just makes it really easy to pick
24
and choose things that you want to check for your own code base.
25
Let's start simple.
26
All I want to do is make sure that before I commit anything, I run my code formatter on it.
27
Of course, I can just run the code formatter before I commit, but the point is I shouldn't have to remember to do that.
28
Why not just make it automatic?
29
Well, it's super simple to set up.
30
Open up your terminal and just pip install pre-commit.
31
Then, at the root of your project, just make a new file called .precommitconfig.yaml.
32
Then, it's just this easy to add automatic code formatting on every commit.
33
You specify precommit hooks by just giving a git repository.
34
In this case, I'm using GitHub, but you can actually use any git repository, even a local one.
35
You specify the git tag that it's going to use, and then some information about what command to run and what arguments to give it.
36
In this case, I'll be using black to do the actual code formatting.
37
Then you use pre-commit to install the githooks into your githooks folder.
38
Now if we go and look in our githooks folder, we see that we have this new pre-commit file.
39
Alright, now let's add our files to git, commit, and see what happens.
40
As you can see, it ran black and the commit failed because some modifications were made, and it's not going to commit anything automatically.
41
I can go and manually inspect the hello file and see that everything looks good, or just compare the diff like I normally would before a commit.
42
Note that these modifications to the hello file were made after the file was staged.
43
That means I need to git add this file again, or if something went wrong and I don't like the changes that were automatically made,
44
then I can git restore the file to go back to the way it was before.
45
In this case, I'm happy with the changes, so I will add and then try to commit again.
46
This time, since everything passed, the commit went through.
47
Note that some graphical editors like this one, PyCharm, have built-in Git support and they will automatically add tracked files when you try to commit.
48
So if that's the case then it might look more like this.
49
Here I have a spurious space in there and I'm going to go ahead and try and commit.
50
Then I try to commit and I see the commit failed and I can go to the console to see what errors.
51
I see that it deleted the extra space
52
and then I can just go ahead and click commit again and then this time it will succeed.
53
So what else can you do besides automatically formatting your code?
54
Well you can write your own commit hooks so you can pretty much do whatever you want, but there are a ton of really good ones already written on this website here.
55
Here are just a few of my favorites.
56
You can delete trailing whitespace, make sure a file is either empty or ends with a new line, make sure that any yaml files have valid yaml in them,
57
make sure you're not accidentally committing any really big files into your repository, and check for any spurious breakpoints that you forgot to delete before committing.
58
You can also run your linter like flake 8, you can reorder and standardize the order that your imports happen in, you can check for outdated syntax and replace it with its modern equivalent,
59
and this would also be a good place to run your type checker, like MyPy.
60
Pre-commit is most popular in the Python world, but it's not something that's just limited to Python.
61
There are premade scripts for doing things like running clang-tidy or clang-format, or some other code formatter for a different language.
62
You don't have to reinstall anything if you change the YAML file, just go ahead and commit.
63
We see the commit failed because of a MyPy error, telling us that we passed the wrong kind of argument to this function f.
64
Also note that most hooks will only run if an applicable file actually changed.
65
So it's not going to be reformatting code that it already formatted and hasn't changed.
66
Finally, there's the question of safety.
67
How safe is it to automatically run programs on your source code before committing them?
68
Well, this ultimately goes down to the project and whether or not you trust the project to do the right thing.
69
Of course, these little scripts can be written by anyone, so if they put something malicious in, then you're going to be out of luck.
70
You can fix a specific version or even a specific hash in the config file.
71
This helps mitigate things like what if this project gets hacked and an attacker uploads something malicious.
72
But as always, only use projects that you really trust.
73
As far as accidental errors go though, like what if black accidentally changed the meaning of the code?
74
Well, that's something that I haven't actually run into.
75
If something did go wrong, it would really be up to you to catch it in the git diff or by running tests.
76
Of course, for an accidental mistake, you can always revert using the git restore command that I talked about earlier.
77
Well, that's all I've got.
78
I hope this makes your repos better.

앱 다운로드

유창하게 말하는 데 필요한 모든 것

AI 발음 평가문장마다 점수 확인
IPA 발음 연습모든 소리 마스터
단어 학습나만의 단어장 만들기
단어 게임놀면서 외우기
FOR YOU

추천 영상

이 레슨의 어휘와 말하기 포인트

이 영상에는 섀도잉할 문장 78개와 단어 1244개가 있습니다. 말하는 구간의 길이는 5:52입니다. 화자는 분당 약 212단어로 빠르게 말하므로 연음과 약하게 발음되는 소리가 많습니다. 영어에서 가장 많이 쓰이는 3,000단어에 속하는 단어가 80%뿐이라 어휘가 어려운 편입니다.

이 영상의 핵심 어휘

영상에 나오는 익혀 둘 만한 단어 15개를 발음, 뜻과 함께 정리했습니다.

단어발음뜻
hook 명사/hʊk/갈고리
format 명사/ˈfɔːɹ.mæt/포맷
folder 명사/ˈfoʊldɚ/서류철, 폴더
script 명사/skɹɪpt/문서, 문장
delete 동사/dɪˈliːt/삭제(削除)하다
automatic 형용사/ˌɔː.təˈmæt.ɪk/자동, 자동적
accidentally 부사/ˌæk.sɪˈdɛnt(ə)li/우연히도
restore 동사/ɹɪˈstoɹ/회복시키다, 재건하다
install 동사/ɪnˈstɔl/설치하다, 깔다
tidy 형용사/ˈtaɪ.di/단정한
compare 동사/kəmˈpɛɚ/비교하다, 비유하다
trail 명사/tɹeɪl/흔적, 자국
valid 형용사/ˈvælɪd/유효하다, 유효
terminal 명사/ˈtɚmɪnəl/터미널, 공항 터미널
depend 동사/dɪˈpɛnd/의존하다, ...에 달려 있다

영상에 나오는 구동사

단어뜻
go down 동사내려가다
go out 동사나가다

주의할 발음

화자는 don't, I'm, you're 같은 축약형과 약화된 형태를 18번 사용합니다. 들리는 대로 짧게 발음하세요.

  • “sh”와 “zh” 소리: modification /ˌmɑdɪfɪˈkeɪʃən/, malicious /məˈlɪʃəs/, notion /ˈnoʊʃən/, hash /ˈhæʃ/
  • 긴 단어 — 강세 위치에 주의: automatic /ˌɔː.təˈmæt.ɪk/, accidentally /ˌæk.sɪˈdɛnt(ə)li/, modification /ˌmɑdɪfɪˈkeɪʃən/, applicable /əˈplɪk.ə.bəl/, directory /dɪˈɹɛktəɹi/

이 영상으로 연습하는 방법

  1. 먼저 말하지 않고 영상을 끝까지 듣고 모르는 단어를 적어 둡니다.
  2. 0.75배속으로 한 문장씩 섀도잉을 시작하고, 익숙해지면 보통 속도로 돌아갑니다.
  3. 자신의 목소리를 녹음해 원본과 비교하고, hook, format, folder 같은 단어에 특히 주의합니다.

이 영상의 문법

화자가 가장 많이 쓰는 문형을 영상 속 실제 표현과 함께 정리했습니다.

문형영상 속 표현
수동태 be + 과거분사 — 누가 하는지보다 무슨 일이 일어나는지에 초점are called · might be hidden · been written
현재완료 have/has + 과거분사 — 과거의 일이 지금도 관련이 있을 때has gone · have already been written · have built

쉐도잉이란? 영어 실력을 빠르게 키우는 과학적 방법

쉐도잉(Shadowing)은 원래 전문 통역사 훈련을 위해 개발된 언어 학습 기법으로, 다언어 학자인 Dr. Alexander Arguelles에 의해 대중화된 방법입니다. 핵심 원리는 간단하지만 매우 강력합니다: 원어민의 영어를 들으면서 1~2초의 짧은 지연으로 즉시 소리 내어 따라 말하는 것——마치 '그림자(shadow)'처럼 화자를 따라가는 것입니다. 문법 공부나 수동적인 청취와 달리, 쉐도잉은 뇌와 입 근육이 동시에 실시간으로 영어를 처리하고 재현하도록 훈련합니다. 연구에 따르면 이 방법은 발음 정확도, 억양, 리듬, 연음, 청취력, 말하기 유창성을 크게 향상시킵니다. IELTS 스피킹 준비와 자연스러운 영어 소통을 원하는 분들에게 특히 효과적입니다.

섀도잉 방법: 단계별 전체 가이드 읽기 →