├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── exercise1.md │ └── exercise2.md └── workflows │ ├── exercise.yml │ └── pr.yml ├── CONTRIBUTING.md ├── LICENSE ├── README.md └── records ├── 03130214.md ├── CapooL.md ├── Clear1ove.md ├── FywOoie.md ├── Gmorning730.md ├── Gmorning800.md ├── LetMeFly666.md ├── README.md ├── Topology2333.md ├── UerLink.md ├── anchorcola.md ├── babuzeer.md ├── butteruni.md ├── hyttest.md ├── kahakaha.md ├── lxirang.md ├── moyu.md ├── mtzhao0827.md ├── norton_lin.md ├── yyf123.md └── zzzYmq.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/exercise1.md: -------------------------------------------------------------------------------- 1 | 练习一:认领 issue 完成第一次 PR 2 | 3 | 提交一个以自己的用户名命名的 `.md` 文件,内容随意。 4 | 5 | 请注意查看 [`CONTRIBUTING.md`](https://github.com/FrogDar/code-contributing-practice/blob/main/CONTRIBUTING.md) 里的规范(比如 git message 要使用 [`angular` 规范](https://github.com/angular/angular/blob/main/CONTRIBUTING.md)) 6 | 7 | 建议自己创建一个分支,并在分支上修改后提交 PR,具体做法和理由见练习二。 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/exercise2.md: -------------------------------------------------------------------------------- 1 | ## 任务 2 | 3 | 随机变更 md 里的内容 4 | 5 | 唯一的要求是:在 PR 里不要出现上次提交的 git 记录。 6 | 7 | ## 方法 8 | 9 | ### 法一 10 | 11 | 如果你的仓库单纯比上游仓库较慢(只有 `behind`),那么可以在仓库内点击同步,同步为最新后再开始编码。 12 | 13 | ![image](https://user-images.githubusercontent.com/20886330/206180947-76205c08-6c33-4dee-85a1-51e82f0d2b23.png) 14 | 15 | ### 法二 16 | 17 | 如果又有 `behind` 又有 `ahead` 那么可以删除仓库,重新 Fork 。 18 | 19 | ### 法三 20 | 21 | 创建单独的分支,利用单独分支执行相关指令拉取最新请求。 22 | 23 | (每次都创建一个新的分支,在那个分支上编码,完成之后就删除新创建的这个分支,保持主分支的干净,那么对于主分支来说就可以使用法一了) 24 | 25 | ```git 26 | git checkout -b new-branch-name 27 | git pull upstream master 28 | ``` -------------------------------------------------------------------------------- /.github/workflows/exercise.yml: -------------------------------------------------------------------------------- 1 | name: Exercise 2 | # on issues created or updated 3 | on: 4 | issues: 5 | types: 6 | - opened 7 | - edited 8 | 9 | permissions: 10 | issues: write 11 | contents: read 12 | 13 | jobs: 14 | ex1: 15 | runs-on: ubuntu-latest 16 | # if issue title is ex1 17 | if: ${{ github.event.issue.title == 'Ex1' || github.event.issue.title == 'ex1' || github.event.issue.title == '练习1' || github.event.issue.title == '练习一' }} 18 | steps: 19 | - uses: actions/checkout@v3 20 | - name: Comment on issue 21 | uses: peter-evans/create-or-update-comment@v2 22 | with: 23 | issue-number: ${{ github.event.issue.number }} 24 | body-file: .github/ISSUE_TEMPLATE/exercise1.md 25 | token: ${{ secrets.GITHUB_TOKEN }} 26 | - name: Add label 27 | uses: andymckay/labeler@master 28 | with: 29 | add-labels: "exercise1" 30 | - name: Assign author to issue 31 | uses: technote-space/assign-author@v1 32 | 33 | ex2: 34 | runs-on: ubuntu-latest 35 | # if issue title is ex2 36 | if: ${{ github.event.issue.title == 'Ex2' || github.event.issue.title == 'ex2' || github.event.issue.title == '练习2' || github.event.issue.title == '练习二' }} 37 | steps: 38 | - uses: actions/checkout@v3 39 | - name: Comment on issue 40 | uses: peter-evans/create-or-update-comment@v2 41 | with: 42 | issue-number: ${{ github.event.issue.number }} 43 | body-file: .github/ISSUE_TEMPLATE/exercise2.md 44 | token: ${{ secrets.GITHUB_TOKEN }} 45 | - name: Add label 46 | uses: andymckay/labeler@master 47 | with: 48 | add-labels: "exercise2" 49 | - name: Assign author to issue 50 | uses: technote-space/assign-author@v1 51 | -------------------------------------------------------------------------------- /.github/workflows/pr.yml: -------------------------------------------------------------------------------- 1 | name: Pull Request Checker 2 | on: 3 | pull_request: 4 | branches: 5 | - main 6 | 7 | permissions: 8 | pull-requests: read 9 | 10 | jobs: 11 | commitlint: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v3 15 | with: 16 | fetch-depth: 0 17 | - uses: actions/setup-node@v2 18 | with: 19 | node-version: '22' 20 | - run: | 21 | npm install --save-dev @commitlint/config-angular @commitlint/cli 22 | echo "module.exports = {extends: ['@commitlint/config-angular']};" > commitlint.config.js 23 | 24 | # Run the commitlint action, considering its own dependencies and yours as well 🚀 25 | # `github.workspace` is the path to your repository. 26 | - uses: wagoid/commitlint-github-action@v6 27 | env: 28 | NODE_PATH: ${{ github.workspace }}/node_modules 29 | with: 30 | helpURL: 'https://github.com/FrogDar/code-contributing-practice/blob/main/CONTRIBUTING.md' 31 | 32 | # check if the PR close an issue in PR body 33 | - name: Check if the PR close an issue in PR body 34 | run: | 35 | if ! echo "${{ github.event.pull_request.body }}" | grep -q "close" ; then 36 | echo "No issue closed in the PR body. Please add a line like 'close #123' to the PR body." 37 | exit 1 38 | fi 39 | 40 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## 任务 2 | 3 | ### 认领 issue 4 | 5 | 创建一个 issue 命名为 `Ex1` 或 `ex1` 或 `练习1` 或 `练习一`,机器人会自动更新任务并将这个 issue 分配给你,请你完成它哦~ 6 | 7 | 后续的其他任务就把 `1` 换成 `2`、`3`等其他编号。 8 | 9 | ### 开始编码(TODO) 10 | 11 | 在点击仓库右上角的 Fork 按钮将在你的账号中创建该仓库的副本。前往你的 GitHub 中的相同仓库,地址通常为 `https://github.com/你的用户名/code-contributing-practice` 接下来将在你自己账号的仓库中操作。 12 | 13 | > 如果你不知道以下说的是什么东西,你可能需要尝试 [GitHub Desktop](https://desktop.github.com/) ,这能帮助你少敲一堆命令,减轻学习 Git 的负担。(不过这不代表不用学习 Git)如果你遇到了困难,请向 mentor 求助。 14 | 15 | 将仓库 clone 到本地,这样本地才有代码,才能对其修改。操作步骤参考 [Cloning a repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) 16 | 17 | 对于本仓库而言,提交的内容具体见 [`records` 目录下的 `README`](https://github.com/FrogDar/code-contributing-practice/tree/main/records)。 18 | 19 | ### 创建 Pull Request 20 | 21 | 参考 [Creating a pull request from a fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) 22 | 23 | > 同样,如果你遇到了困难,请向 mentor 求助。 24 | 25 | 在你创建 Pull Request 后,你会看到 checks running ,请留意失败的 checks ,这通常意味着你提交的代码可能存在问题。 26 | 27 | 在本仓库中主要是对规范性进行检查,如 git message 是否遵守规范?是否在 PR 中关闭对应的 issue 等。 28 | 29 | ### 等待 Code Review 30 | 31 | 你提交的 Pull Request 将在 review 后合并入仓库。如果有需要改进的地方,你的 reviewer 会在 Pull Request 下留言,所以请留意你的 reviewer 给你的消息(不过也不用担心,你会收到邮件提醒)。 32 | 33 | ### Commit 规范 34 | 35 | > 本节主要参考自 [`angular`](https://github.com/angular/angular/blob/main/CONTRIBUTING.md) 。 36 | > 更宽松地要求可以参见 [How to Write a Git Commit Message](https://cbea.ms/git-commit/) ,这里给出一些最基本的要求。 感谢 @derecknowayback 的分享。 37 | 38 | 每一个 Git commit message 由 **header** 和 **body** 组成。 39 | 40 | ``` 41 |
42 | 43 | 44 | ``` 45 | 46 | #### **header** 47 | 48 | header 是必须的,格式如下: 49 | 50 | ``` 51 | (): 52 | │ │ │ │ 53 | │ │ │ └─⫸ 原则上使用英文;使用动词原形开头,首字母不需要大写,句尾不需要句号(整句尽量不超过60词) 54 | │ │ │ 55 | │ │ └─⫸ 冒号后面需要一个半角空格 56 | │ │ 57 | │ └─⫸ Commit Scope: 特定范围(对于本仓库而言一般为空) 58 | │ 59 | └─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|test|style|chore|revert 60 | ``` 61 | 62 | ##### Commit Type 63 | 64 | * **build**: 影响构建系统或者外部依赖的更改,例如修改 `pom.xml`, `Dockerfile`, `docker-compose.yml` 的更改 65 | * **ci**: 影响到 CI 配置或脚本的更改,例如修改 `gitlab-ci.yml`, Github Actions 的配置文件等 66 | * **docs**: 只修改了文档的更改 67 | * **feat**: 增加新功能的更改 68 | * **fix**: 修复 bug 的更改 69 | * **perf**: 提高了程序性能的更改 70 | * **refactor**: 既没有修复 bug 也没有增加新功能的更改(比如重构代码) 71 | * **test**: 增加或改正测试代码 72 | * **style**: 不改变代码含义的修改(比如格式化代码) 73 | * **chore**: 其他不改变 `src` 或测试代码的修改 74 | * **revert**: 撤回之前的 `commit` 75 | 76 | #### scope 77 | 78 | commit 所属的范围,例如 `frontend`、`backend` 等。 79 | 80 | 如果 commit 不属于特定范围,则不用加 scope 。 81 | #### body 82 | 83 | body 是可选的,与 header 一样,需要使用动词原形。body 中可以书写比 header 中更详细的信息,比如: 84 | 85 | - 为什么做了这个更改 86 | - 受到了什么启发 87 | - 与之前版本的区别 88 | - 功能的详细说明 89 | - …… 90 | 91 | #### 样例 92 | 93 | ``` 94 | fix: address an issue where return value can be null 95 | 96 | if an incorrect request body is sent to the server, method xxx may respond with a empty body due to xxx 97 | this issue is fixed by improving error handling in the request parser 98 | ``` 99 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # code-contributing-practice 2 | 3 | > 练习代码贡献中的 `fork` 、`pull request` 等操作。 4 | 5 | ## 为仓库贡献代码应当怎么做? 6 | 7 | - 注意阅读仓库的 `contributing.md` 文档,它通常位于仓库的根目录或 `docs` 文件夹下。 8 | - 认领 issue 9 | - 开始编码 10 | - 创建 Fork 仓库或同步 Fork 仓库 11 | - 创建或选定分支 12 | - 提交代码 13 | - 创建 Pull Request 14 | - 在 PR 的描述部分中加上 `close #123` (假定你要完成的 issue 编号是 123 的话) 15 | 16 | - 等待代码审查 17 | 18 | ## 练习 19 | 20 | > 在练习中提交的内容没有限制,可以是在 `records` 文件夹下提交一个属于自己的 `.md` 文件,也可以是完善本仓库。 21 | > 22 | > 需要注意的是,练习失败的那些产物对于新手来说只能是删掉再来一次。当然你也可以通过提升自己的 git 水平,用一些奇淫巧技拯救此前错误的练习结果。 23 | 24 | ### 练习一 25 | 26 | 练习目标:完成第一次提交 27 | 28 | 注意事项: 29 | 30 | - 创建一个 issue,标题命名为 `Ex1` 或 `ex1` 或 `练习1` 或 `练习一`,机器人会将它分配给你,成为你的专属练习 issue 31 | - 记得查看 [`CONTRIBUTING.md`](https://github.com/FrogDar/code-contributing-practice/blob/main/CONTRIBUTING.md) 里的规范(比如 git message 要使用 [`angular` 规范](https://github.com/angular/angular/blob/main/CONTRIBUTING.md)) 32 | - 建议自己创建一个分支,并在分支上修改后提交 PR,具体做法和理由见练习二。 33 | 34 | ### 练习二 35 | 36 | 练习目标:完成第二次提交 37 | 38 | 注意事项: 39 | 40 | - 创建一个 issue,标题命名为 `Ex2` 或 `ex2` 或 `练习2` 或 `练习二`,机器人会将它分配给你,成为你的专属练习 issue 41 | - 务必保持此次提交不包括上次提交的 git message。 42 | 43 | ## TODO 44 | 45 | - [x] 基本文字介绍 46 | - [x] 完成第一个贡献流程 47 | - [x] 完成一次手动评判 48 | - [x] 利用 `GitHub Actions` 自动评判流程并给予提示 49 | - [ ] 更为充实的文字介绍 50 | -------------------------------------------------------------------------------- /records/03130214.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lin594/code-contributing-practice/08d0d8559986ef32213b849fdfc0978169d92717/records/03130214.md -------------------------------------------------------------------------------- /records/CapooL.md: -------------------------------------------------------------------------------- 1 | He lived, he loved, he wrote. -------------------------------------------------------------------------------- /records/Clear1ove.md: -------------------------------------------------------------------------------- 1 | # QuQ 2 | 3 | asdfgjkh 4 | 5 | -------------------------------------------------------------------------------- /records/FywOoie.md: -------------------------------------------------------------------------------- 1 | Jam a man with fortune and J must seek my fortune 2 | -HENRY AEVERIEES 1994.1.11 -------------------------------------------------------------------------------- /records/Gmorning730.md: -------------------------------------------------------------------------------- 1 | ![image-20230321225513213](C:\Users\HONOR\AppData\Roaming\Typora\typora-user-images\image-20230321225513213.png) 2 | 3 | 瓦达西哇八嘎() 4 | -------------------------------------------------------------------------------- /records/Gmorning800.md: -------------------------------------------------------------------------------- 1 | 二战 (._.) 2 | 上岸 3 | -------------------------------------------------------------------------------- /records/LetMeFly666.md: -------------------------------------------------------------------------------- 1 | 你说的对,但是《原神》是由米哈游自主研发的一款全新开放世界冒险游戏。游戏发生在一个被称作「提瓦特」的幻想世界,在这里,被神选中的人将被授予「神之眼」,导引元素之力。你将扮演一位名为「旅行者」的神秘角色,在自由的旅行中邂逅性格各异、能力独特的同伴们,和他们一起击败强敌,找回失散的亲人——同时,逐步发掘「原神」的真相。 2 | 3 | ![八重神子.jpg](https://uploadstatic.mihoyo.com/ys-obc/2022/02/07/4328207/d91da42730562d579a7bb00b5715ab9a_4062516161434592213.png) 4 | -------------------------------------------------------------------------------- /records/README.md: -------------------------------------------------------------------------------- 1 | ## 说明 2 | 3 | ### 提交内容 4 | 5 | 以自己的用户名为名的 `markdown` 文件,内容不做限制。 6 | 7 | ### TODO 8 | 9 | - [ ] 多次 commit 之后的练习 10 | - [ ] 文件冲突的解决 11 | -------------------------------------------------------------------------------- /records/Topology2333.md: -------------------------------------------------------------------------------- 1 | # CEREATED ON 03/17/2023 2 | ## CHINESE REFUSED 3 | 4 | 不知道要写什么了,,大青蛙最棒 -------------------------------------------------------------------------------- /records/UerLink.md: -------------------------------------------------------------------------------- 1 | ## 练习一 2 | 1. 创建了一个uerlink分支,进行提交但是失败了,删除后再次尝试 3 | 2. 原来不是手动关闭issues 4 | 3. doce: 后面有空格 5 | 6 | ## 练习二 7 | 1. 创建了一个新分支 mian-uerlink 8 | ![](https://s1.ax1x.com/2022/04/05/qLO7l9.gif)ian -------------------------------------------------------------------------------- /records/anchorcola.md: -------------------------------------------------------------------------------- 1 | 劳动最光荣,本人最没用 2 | 没关系情绪稳定一分钟也很厉害了没关系情绪稳定-一分钟也很厉害了 沒關係 情緒穩定一分鐘也很厲害 沒dhdhb精定神穩一分鐘也厲很害了 沒guan 沒關係精穩①分鐘也很厲shshbs了沒關係shbsjajaksnnx精神穩定一分鐘也很厲害了 沒關係精神穩定一v49'cds&uC5(dJef:,&/9支arfnzId;!&:2$上勾拳!下勾拳!左勾拳!扫堂腿!回旋踢!蜘蛛吃耳屎,龙卷风摧毁停车场!羚羊蹬,山羊跳!乌鸦坐飞机!老鼠走迷宫!大象踢腿!愤怒的章鱼!巨斧砍大树!彻底疯狂!彻底疯狂!彻底疯狂!彻底疯狂!彻底疯狂!彻底疯狂!彻底疯狂!彻底疯狂!彻底疯狂!!!!! 3 | -------------------------------------------------------------------------------- /records/babuzeer.md: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | struct Node{ 5 | int number,age; 6 | char *name,*gender; 7 | struct Node * next; 8 | }; 9 | typedef struct Node * PtrNode; 10 | PtrNode initEmptyList();//初始化链表 11 | void insertBegin(PtrNode head, int a,char* name,char* gender,int age);//从头插入一个元素 12 | void printList(PtrNode head);//打印链表 13 | PtrNode reverselink(PtrNode head);//逆置链表 14 | void destroyList(PtrNode headPtr);//释放链表 15 | PtrNode checkout(int start,PtrNode head2);//寻找开始的位置,找到则返回指针 16 | int countremain(PtrNode head2);//记录剩余人数 17 | int main(){ 18 | PtrNode head=NULL,head2=NULL; 19 | int n,number,age,start,interval,remain,count=1; 20 | char *name,*gender; 21 | scanf("%d",&n); 22 | head=initEmptyList(); 23 | for(int i=0;iremain){//实际剩余人数大于目标剩余人数则持续进行 39 | count=1; 40 | while(countnext; 43 | else{ 44 | count++; 45 | control=control->next; 46 | if(control==head2)//循环到头指针时跳过 47 | control=control->next; 48 | } 49 | } 50 | while(controlfront->next!=control)//得到当前指针的前驱指针 51 | controlfront=controlfront->next; 52 | controlfront->next=control->next;//记录将要删除节点的下一节点 53 | printf("%d %s %s %d\n",control->number,control->name,control->gender,control->age); 54 | free(control); 55 | control=controlfront->next;//当前指针指向下一个节点 56 | } 57 | printList(head2); 58 | destroyList(head2); 59 | return 0; 60 | } 61 | PtrNode initEmptyList(){ 62 | PtrNode head = malloc(sizeof(struct Node));//动态分配新节点 63 | if ( head != NULL){ 64 | head->next = head; 65 | } 66 | return head; 67 | } 68 | void insertBegin(PtrNode head,int a,char* name,char* gender,int age){ 69 | PtrNode p;//动态分配新节点,将新值存入 70 | p = malloc(sizeof(struct Node)); 71 | if (p != NULL){ 72 | p->number=a; 73 | p->name=name; 74 | p->gender=gender; 75 | p->age=age; 76 | p->next=head->next;//直接在空节点后链接新节点 77 | head->next=p; 78 | } 79 | else 80 | printf("Not inserted. No memory avaliable.\n"); 81 | } 82 | void printList(PtrNode head){ 83 | PtrNode cur=head->next; //跳过空节点 84 | if (cur==head) 85 | printf("The list is empty.\n"); 86 | else{ 87 | printf("The list is:\n"); 88 | while(cur!=head){ 89 | printf("%d %s %s %d\n",cur->number,cur->name,cur->gender,cur->age); 90 | cur = cur->next; 91 | } 92 | cur=cur->next; 93 | } 94 | } 95 | void destroyList(PtrNode headPtr) 96 | { 97 | PtrNode tempPtr; 98 | while (headPtr->next!=headPtr){ 99 | tempPtr=headPtr->next; 100 | headPtr->next=tempPtr->next; 101 | free(tempPtr); 102 | } 103 | tempPtr=headPtr; 104 | free(tempPtr); 105 | headPtr=NULL; 106 | } 107 | PtrNode reverselink(PtrNode head) 108 | { 109 | PtrNode temp=head->next,track=NULL,head2=NULL; 110 | head2=initEmptyList(); 111 | while(temp!=head){ 112 | track=head2->next;//记录链表2后继 113 | head2->next=temp;//读取链表1中元素 114 | temp=temp->next;//移向下一个节点 115 | head2->next->next=track;//将链表2后继连上去 116 | } 117 | free(head); 118 | return head2; 119 | } 120 | PtrNode checkout(int start,PtrNode head2) 121 | { 122 | PtrNode check=NULL; 123 | check=head2->next; 124 | while(check->next!=head2){//遍历链表,按编号寻找开始位置 125 | if(check->number==start) 126 | return check; 127 | check=check->next; 128 | } 129 | if(check->number!=start) 130 | return NULL; 131 | return NULL; 132 | } 133 | int countremain(PtrNode head2) 134 | { 135 | int num=1; 136 | PtrNode temp=head2->next; 137 | if(temp==head2) 138 | num=0; 139 | while(temp->next!=head2){ 140 | num++; 141 | temp=temp->next; 142 | } 143 | return num; 144 | } -------------------------------------------------------------------------------- /records/butteruni.md: -------------------------------------------------------------------------------- 1 | test 2 -------------------------------------------------------------------------------- /records/hyttest.md: -------------------------------------------------------------------------------- 1 | 试一下。 2 | -------------------------------------------------------------------------------- /records/kahakaha.md: -------------------------------------------------------------------------------- 1 | 你说得对,但是`<>`是由大青蛙自主研发的一款全新开放世界代码提交游戏。游戏发生在一个被称作`github`的幻想世界,在这里,被bot选中的人将被授予`issue`,导引开源之力。你将扮演一位名为`contributor`的神秘角色,在自由的旅行中邂逅性格各异、能力独特的coder们,和他们一起击败强敌,cv各种代码。同时,逐步发掘`github`的真相。 -------------------------------------------------------------------------------- /records/lxirang.md: -------------------------------------------------------------------------------- 1 | 01 2 | 10 3 | -------------------------------------------------------------------------------- /records/moyu.md: -------------------------------------------------------------------------------- 1 | 1111111111111111111111111 -------------------------------------------------------------------------------- /records/mtzhao0827.md: -------------------------------------------------------------------------------- 1 | hello 2 | 3 | -------------------------------------------------------------------------------- /records/norton_lin.md: -------------------------------------------------------------------------------- 1 | # here is my profile 2 | 事实上我也不知道青蛙要干嘛 -------------------------------------------------------------------------------- /records/yyf123.md: -------------------------------------------------------------------------------- 1 | ### test 2 | 3 | username 4 | 5 | password 6 | 7 | -------------------------------------------------------------------------------- /records/zzzYmq.md: -------------------------------------------------------------------------------- 1 | #1111 by zzzYmq second 2 | --------------------------------------------------------------------------------