-
Notifications
You must be signed in to change notification settings - Fork 1k
Update CONTRIBUTING.md to enhance development guidelines #824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,76 @@ | ||
## How to contribute to LINE Bot SDK for Python project | ||
# How to contribute to LINE Bot SDK for Python project | ||
|
||
First of all, thank you so much for taking your time to contribute! LINE Bot SDK for Python is not very different from any other open | ||
source projects you are aware of. It will be amazing if you could help us by doing any of the following: | ||
First of all, thank you so much for taking your time to contribute! | ||
LINE Bot SDK for Python is not very different from any other open source projects you are aware of. | ||
It will be amazing if you could help us by doing any of the following: | ||
|
||
- File an issue in [the issue tracker](https://github.com/line/line-bot-sdk-python/issues) to report bugs and propose new features and | ||
improvements. | ||
- Ask a question using [the issue tracker](https://github.com/line/line-bot-sdk-python/issues). | ||
- File an issue in [the issue tracker](https://github.com/line/line-bot-sdk-python/issues) to report bugs and propose new features and improvements. | ||
- Ask a question using [the issue tracker](https://github.com/line/line-bot-sdk-python/issues) (__Please ask only about this SDK__). | ||
- Contribute your work by sending [a pull request](https://github.com/line/line-bot-sdk-python/pulls). | ||
|
||
### Contributor license agreement | ||
## Development | ||
|
||
### Install dependencies | ||
|
||
Run `pip install -r requirements-dev.txt` to install all dependencies for development and testing. | ||
|
||
### Understand the project structure | ||
|
||
The project structure is as follows: | ||
|
||
- `linebot`: The main library code. | ||
- `tests`: Test code. | ||
- `examples`: Example projects that use the library. | ||
- `generator`: Custom OpenAPI generator for Python code. | ||
- `tools`: Development tools. | ||
- `docs`: Documentation files for Sphinx. | ||
|
||
### Edit OpenAPI templates | ||
|
||
Most of the API client code is generated with OpenAPI Generator based on [line-openapi](https://github.com/line/line-openapi)'s YAML files. | ||
You cannot edit almost all code under `linebot/v3/` directly. | ||
|
||
If you need to change the generated code, you should modify the custom templates under: | ||
- `generator/src/main/resources/python-nextgen-custom-client/` | ||
|
||
After editing the templates, run `python generate-code.py` to regenerate the code, and then commit all affected files. | ||
If not, CI status will fail. | ||
|
||
When you update code, be sure to check consistencies between generated code and your changes. | ||
|
||
### Add unit tests | ||
|
||
We use [pytest](https://pytest.org/) for unit tests. | ||
Please add tests to the appropriate test directories to verify your changes. | ||
|
||
Especially for bug fixes, please follow this flow for testing and development: | ||
1. Write a test before making changes to the library and confirm that the test fails. | ||
2. Modify the code of the library. | ||
3. Run the test again and confirm that it passes thanks to your changes. | ||
|
||
### Run your code in your local environment | ||
|
||
You can use the [example projects](examples/) to test your changes locally before submitting a pull request. | ||
|
||
### Run CI tasks in your local environment | ||
|
||
Test by using tox. | ||
To run all tests and to run flake8 against all versions, use: `tox` | ||
|
||
To run all tests against version 3.10, use: `tox -e py3.10` | ||
|
||
To run a test against version 3.10 and against a specific file, use: `tox -e py3.10 -- tests/test_webhook.py` | ||
|
||
### Documentation | ||
|
||
If you edit README.rst, you should execute the following command to check the syntax of README. | ||
|
||
``` | ||
python -m readme_renderer README.rst | ||
``` | ||
|
||
## Contributor license agreement | ||
|
||
When you are sending a pull request and it's a non-trivial change beyond fixing typos, please make sure to sign | ||
[the ICLA (individual contributor license agreement)](https://cla-assistant.io/line/line-bot-sdk-python). Please | ||
[contact us](mailto:dl_oss_dev@linecorp.com) if you need the CCLA (corporate contributor license agreement). | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be excluded as it duplicates the content of CONTRIBUTING.md. Since there is already a link to CONTRIBUTING.md, it is unnecessary.