如何为新用户设置 GitHub 中的操作?
How to set up actions in GitHub for new user?
我刚刚获得了一个 GitHub 帐户并正在 Python 中编写小脚本,我正在学习。
将我的代码添加到 GitHub 时,我注意到我的代码上有一个 运行 tests/validation 选项,但我的代码是空的。
我四处搜索,发现 lint 和 black 是很好的支票。
我找到了我要添加的这个 Action - https://github.com/marketplace/actions/python-quality-and-format-checker
有一个 "script" 和一个 "config" 我想我需要在某个地方 add/update。此外,当我单击 "Use latest version" 时,它告诉我将代码添加到一些 .yml 中。
任何人都可以帮助我安装此 Action 或为我指明正确的方向吗?另外,如何在我的所有 repositories/code 上使用此操作?
=======================================
编辑:
这个link有说明-https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow
将yaml或yml放在这个目录下 -> .github/workflows
对于此操作:https://github.com/marketplace/actions/python-quality-and-format-checker
文件中的代码如下所示:
on: [push, pull_request]
name: Python Linting
jobs:
PythonLinting:
name: Python linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Konstruktoid Python linting
uses: konstruktoid/action-pylint@master
pylint
is part of the new GitHub Super Linter (github/super-linter
):
Introducing GitHub Super Linter: one linter to rule them all
The Super Linter is a source code repository that is packaged into a Docker container and called by GitHub Actions. This allows for any repository on GitHub.com to call the Super Linter and start utilizing its benefits.
When you’ve set your repository to start running this action, any time you open a pull request, it will start linting the code case and return via the Status API.
It will let you know if any of your code changes passed successfully, or if any errors were detected, where they are, and what they are.
This then allows the developer to go back to their branch, fix any issues, and create a new push to the open pull request.
At that point, the Super Linter will run again and validate the updated code and repeat the process.
并且您可以将其设置为 only int new files if you want。
2020 年 8 月更新:
github/super-linter
issue 226 has been closed with PR 593:
This Pr will add:
- Black python linting
- Updated tests
我刚刚获得了一个 GitHub 帐户并正在 Python 中编写小脚本,我正在学习。
将我的代码添加到 GitHub 时,我注意到我的代码上有一个 运行 tests/validation 选项,但我的代码是空的。
我四处搜索,发现 lint 和 black 是很好的支票。
我找到了我要添加的这个 Action - https://github.com/marketplace/actions/python-quality-and-format-checker
有一个 "script" 和一个 "config" 我想我需要在某个地方 add/update。此外,当我单击 "Use latest version" 时,它告诉我将代码添加到一些 .yml 中。
任何人都可以帮助我安装此 Action 或为我指明正确的方向吗?另外,如何在我的所有 repositories/code 上使用此操作?
=======================================
编辑:
这个link有说明-https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow
将yaml或yml放在这个目录下 -> .github/workflows
对于此操作:https://github.com/marketplace/actions/python-quality-and-format-checker
文件中的代码如下所示:
on: [push, pull_request]
name: Python Linting
jobs:
PythonLinting:
name: Python linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Konstruktoid Python linting
uses: konstruktoid/action-pylint@master
pylint
is part of the new GitHub Super Linter (github/super-linter
):
Introducing GitHub Super Linter: one linter to rule them all
The Super Linter is a source code repository that is packaged into a Docker container and called by GitHub Actions. This allows for any repository on GitHub.com to call the Super Linter and start utilizing its benefits.
When you’ve set your repository to start running this action, any time you open a pull request, it will start linting the code case and return via the Status API.
It will let you know if any of your code changes passed successfully, or if any errors were detected, where they are, and what they are.
This then allows the developer to go back to their branch, fix any issues, and create a new push to the open pull request.
At that point, the Super Linter will run again and validate the updated code and repeat the process.
并且您可以将其设置为 only int new files if you want。
2020 年 8 月更新:
github/super-linter
issue 226 has been closed with PR 593:
This Pr will add:
- Black python linting
- Updated tests