github徽章_如何使用GitHub徽章停止感觉像菜鸟一样

github徽章

Impostor Syndrome is real, and it plagues new developers. We get all the way through a tutorial, bootcamp, or even a degree, yet we still shy away from sharing our code. We fear negative feedback on our code’s quality. No one suffers more from this than self-taught developers. Because we don’t have any “real” or “official” experience or training, we consider our code to be sub-par.

冒名顶替综合症是真实的,并且困扰着新开发人员。 我们一直通过教程,训练营甚至学位来学习,但是我们仍然回避共享代码。 我们担心会对我们的代码质量产生负面反馈。 没有人比自学成才的开发人员遭受更多的痛苦。 因为我们没有任何“真实的”或“官方的”经验或培训,所以我们认为我们的代码未达到标准。

I was there a few months ago. I was working through Harry Percival’s Test-Driven Development With Python. Even though I was following right along with the tutorial, I was self-conscious about sharing my code. Even though my app was working as expected, I didn’t want to share my progress. I didn’t want someone to call me out on some obvious mistake to which I was oblivious. I wanted other people to enjoy my product, but I didn’t want them to see how poor of a developer I was.

几个月前我在那里。 我正在研究Harry Percival的Python测试驱动开发 Ë法师虽然我是正确随着教程之后,我是自我意识分享我的代码。 即使我的应用程序按预期运行,我也不想分享自己的进度。 我不希望有人对我遗忘的一些明显错误大声疾呼。 我希望其他人喜欢我的产品,但我不希望他们看到我有多么贫穷。

After taking a break from my own project, I started looking at some other projects on GitHub. I found a few that had a little image on their README pages.

在完成自己的项目后 ,我开始在GitHub上查看其他项目。 我发现其中一些在自述页面上的图片有点像。

Now, being the noob that I was, I thought this was simply an image that Linus Torvalds handed you on a flash drive when you graduated from “Real Developer” school. Never once did it cross my mind to click on it. I thought it was a static image hosted somewhere in the repository. Later on, I stumbled upon a project that displayed that the build was failing.

现在,作为我的菜鸟,我认为这只是莱纳斯·托瓦尔兹(Linus Torvalds)从“真实开发者”学校毕业时将您交给闪存驱动器的一幅图像。 点击它从来没有一次让我大吃一惊。 我认为这是在存储库中某个位置托管的静态映像。 后来,我偶然发现了一个显示构建失败的项目。

Why would someone take the time to add an image that says their build isn’t passing? Why go through the effort to take down the other image, put up this one? An image that says your project is broken and display it for the world to see? Out of sheer curiosity, I pulled up the raw format for the README. I saw this code:

为什么有人会花时间添加一张图像,表明他们的构建没有通过? 为什么要努力消除另一个形象,把这个形象摆好? 一张说明您的项目已损坏并显示给全世界的图像? 出于好奇,我提出了README的原始格式。 我看到了以下代码:

[![Build Status](https://travis-ci.com/username/projectname.svg?branch=master)](https://travis-ci.com/username/projectname)

I was savvy enough with markdown to recognize that this was a clickable link. So I clicked the button and it took me to Travis-CI. All at once it made sense to me. This button was not updated by the project developer, Travis-CI updated it. It’s a dynamic button.

我对降价很了解,以至于意识到这是一个可点击的链接。 因此,我单击了按钮,然后我进入了Travis-CI。 这一次对我来说很有意义。 项目开发人员未更新此按钮,Travis-CI更新了它。 这是一个动态按钮。

我的第一枚徽章 (My First Badge)

So, once I found out about the build badge from Travis-CI, I had to have it for my project. After all, my whole project was about writing and using tests. So why not have something that ran them automatically?

因此,一旦我从Travis-CI找到了构建徽章,就必须在我的项目中使用它。 毕竟,我的整个项目都是关于编写和使用测试的。 那么,为什么不拥有自动运行它们的功能呢?

So I set up Travis-CI to run my unit tests when I pushed changes to GitHub. Right at the top of the page where Travis-CI runs them, there is the badge. I clicked it and got the markdown. I added it to my README. I navigated to the project page on GitHub and VOILA! There was my first badge. I was hooked!

因此,当我将更改推送到GitHub时,我设置了 Travis-CI来运行我的单元测试。 在Travis-CI运行它们的页面顶部,有徽章。 我单击它并获得减价。 我将其添加到自述文件中。 我导航到GitHub和VOILA上的项目页面! 有我的第一个徽章。 我被迷住了!

狩猎 (The Hunt)

I enjoyed that the badge was a clear sign of the current status of my project. I wanted to learn more, so I went on the hunt for other badges. Another common badge I found was code coverage. The coverage report could be sent by Travis-CI to a tool called CodeCov. You could get a badge indicating the coverage of your tests, which correlates to how well your app is tested.

我很高兴看到徽章是我项目当前状态的清晰标志。 我想了解更多,所以我继续寻找其他徽章。 我发现的另一个常见标志是代码覆盖率。 Travis-CI可以将覆盖率报告发送到称为CodeCov的工具 您可能会获得一个表明测试覆盖范围的标志,该标志与您的应用程序的测试程度相关。

I also found License badges, and it only made sense to have a license badge if I had a license. So I chose a license and added it to the repo. Getting the badge for that took a quick Google Search, and I found this gist with all the common license badges.

我还找到了许可证徽章,只有拥有许可证后才拥有许可证徽章才有意义。 因此,我选择了一个许可证并将其添加到存储库中。 快速获得Google的徽章后,我便找到了所有通用许可徽章的要旨

Coming from a security background in the military, I know that most vulnerabilities come from out-of-date software. As a new developer, I know this also goes for software that your software depends on. I heard about PyUp through Michael Kennedy’s Talk Python to Me podcast. When I navigated to the site, I saw the words I’d begun to love seeing, “Free For Open Source”. Being on the hunt for new badges, I was in luck. Sure enough, they provide a badge, so of course, I add it to the README.

出于军事方面的安全背景,我知道大多数漏洞来自过时的软件。 作为新开发人员,我知道您的软件所依赖的软件也是如此。 我通过Michael KennedyTalk Python to Me播客听说了PyUp。 当我导航到该站点时 ,我看到了我开始喜欢看到的“免费开源”字样。 在寻找新徽章的过程中,我很幸运。 当然,他们提供了徽章,因此,我当然将其添加到自述文件中。

Finally, I discovered that you could have a badge for style. I’d messed around with Black before, and I found an example of the style badge and I knew I had to have it. For my own integrity’s sake, I wanted to ensure that my code was always compliant with Black’s style. I found out about pre-commit, which I could use to format my code before even committing it. After diving down the pre-commit rabbit hole (which also runs my code against bandit for security and sorts my imports and requirements), I felt confident adding the Black badge to my README.

最终,我发现您可能拥有风格徽章。 之前,我曾把Black弄得一团糟,然后找到了一个风格徽章的例子,我知道我必须拥有它。 为了我自己的完整性,我想确保我的代码始终符合Black的风格。 我发现了pre-commit ,甚至可以在提交之前使用它来格式化代码。 深入探究了预先提交的兔子漏洞之后(为了安全起见,我的代码也针对土匪运行,并对我的导入和要求进行了排序),我有信心在自己的自述文件中添加黑色徽章。

最终结果 (The End Result)

The first result of hunting badges is that I have a better quality project. I added a license to my project, ensured my dependencies stayed up to date, and kept my project style compliant because I wanted the badges.

狩猎徽章的第一个结果是我有一个质量更好的项目 。 我向项目添加了许可证,确保我的依存关系保持最新状态,并保持项目风格兼容,因为我需要徽章。

More notably, I am more confident in my project. I can speak about it knowing that there aren’t any gaping holes in it. I know I’m a lot less likely to receive feedback on my irresponsibility in regards to security or my lack of style compliance.

更值得注意的是, 我对自己的项目更有信心。 我可以在没有任何漏洞的情况下谈论它。 我知道我不太可能收到有关安全性或缺乏样式合规性的反馈。

To put it simply, I feel better about my code because I have those GitHub badges.

简而言之,我对代码感觉更好,因为我拥有那些GitHub徽章。

翻译自: https://www.freecodecamp.org/news/how-to-use-badges-to-stop-feeling-like-a-noob-d4e6600d37d2/

github徽章

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值