We are excited that you are willing to contribute to CPTH! After reading the following, you'll know how to write your own header and get merged into CPTH.
Working on your first Pull Request? You can learn how from this free series How to Contribute to an Open Source Project on GitHub.
Learn Git Branching also helps you become a Git expert, but be calm, even you are not familiar with Git, you can also contribute to CPTH.
Please follow the issue templates when opening issues, that would be very helpful.
Contributing is easy — you can just write CP problems using CPTH, and upload them in the tests!
A header consists of the following:
- The header itself at
headers/headerName.h
. - A document which describes how to use the header, including the description for each function, at
docs/headerName.md
. - A short introduction of this header and links to the header, the document and one of its tests at HEADER_LIST.md.
- At least one test, which consists of:
tests/testName/testName.md
, describe the problem.tests/testName/testName.cpp
, use CPTH to solve the problem.tests/testName/testName_bf.cpp
, use brute force to solve the problem.tests/testName/testName_gen.cpp
, generate a testcase for the problem.tests/testName/testName_check.cpp
, use testlib to check if the answer is correct.
You can use create_header.sh to generate the above files.
After finishing all the above files, you can run run_all_tests.sh.
After "All tests passed.", you are done!
Open a pull request, wait for review, apply the suggestions, then your changes will be merged.
It's better to follow these rules:
- Use Clang Format 9 and .clang-format to format your codes.
- Silence all warnings in your codes.
- Try to follow this blog and Conventional Commits when writing commit messages.
- Obey the Code of Conduct.