From 59894979ef6dc7c57850d334a0dde61efdd616d1 Mon Sep 17 00:00:00 2001 From: Guangya Liu Date: Mon, 23 Dec 2024 09:02:02 -0500 Subject: [PATCH] [chore] Removed $ from command for contribution guidance (#3114) The copy in markdown file always copy the $ as well when copying the command, I need to remove the $ manually each time. Co-authored-by: Leighton Chen Co-authored-by: Riccardo Magliocchetti --- CONTRIBUTING.md | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ab22d3821f..8119304875 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,7 +56,7 @@ some aspects of development, including testing against multiple Python versions. To install `tox`, run: ```sh -$ pip install tox +pip install tox ``` You can run `tox` with the following arguments: @@ -74,13 +74,13 @@ You can run `tox` with the following arguments: `ruff check` and `ruff format` are executed when `tox -e ruff` is run. We strongly recommend you to configure [pre-commit](https://pre-commit.com/) locally to run `ruff` automatically before each commit by installing it as git hooks. You just need to [install pre-commit](https://pre-commit.com/#install) in your environment: ```console -$ pip install pre-commit -c dev-requirements.txt +pip install pre-commit -c dev-requirements.txt ``` and run this command inside the git repository: ```console -$ pre-commit install +pre-commit install ``` See @@ -126,31 +126,45 @@ pull requests (PRs). To create a new PR, fork the project in GitHub and clone the upstream repo: ```sh -$ git clone https://github.com/open-telemetry/opentelemetry-python-contrib.git -$ cd opentelemetry-python-contrib +git clone https://github.com/open-telemetry/opentelemetry-python-contrib.git +cd opentelemetry-python-contrib ``` Add your fork as an origin: ```sh -$ git remote add fork https://github.com/YOUR_GITHUB_USERNAME/opentelemetry-python-contrib.git +git remote add fork https://github.com/YOUR_GITHUB_USERNAME/opentelemetry-python-contrib.git ``` -Run tests: +make sure you have all supported versions of Python installed, install `tox` only for the first time: ```sh -# make sure you have all supported versions of Python installed -$ pip install tox # only first time. -$ tox # execute in the root of the repository +pip install tox +``` + +Run tests in the root of the repository (this will run all tox environments and may take some time): + +```sh +tox ``` Check out a new branch, make modifications and push the branch to your fork: ```sh -$ git checkout -b feature -# edit files -$ git commit -$ git push fork feature +git checkout -b feature +``` + +After you edit the files, stage changes in the current directory: + +```sh +git add . +``` + +Then run the following to commit the changes: + +```sh +git commit +git push fork feature ``` Open a pull request against the main `opentelemetry-python-contrib` repo.