Skip to content

Commit bb10251

Browse files
authored
Reformat miscellaneous .md files outside of docs/ (#6999)
* Reformat & mildly edit CONTRIBUTING.md 1) Reformat to follow Google Markdown style guidelines. 2) Make very small edits in a few places for clarification and consistency. * Reformat & edit release.md 1) Reformat to follow Google Markdown style guidelines. 2) Edit the text for (hopefully) improved clarity. 3) Fix minor typos. * Reformat md -- no content change Reformatted using markdownlint. * Reformat md & make trivial edit Reformatted using markdownlint, and made a minor edit to the first sentence. * Reformat md and add a link * Reformat and make corrections & edits * Reformat md * Reformat md to following Google Markdown style Ran files through markdownlint and manually corrected some things. * Delete trailing whitespace Per comment by @Pavol at #6999 (review) * Use a more descriptive title Per suggestion by @Pavol at #6999 (comment)
1 parent d936ee3 commit bb10251

File tree

11 files changed

+547
-318
lines changed

11 files changed

+547
-318
lines changed

CONTRIBUTING.md

Lines changed: 61 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# How to Contribute
22

3-
We'd love to accept your patches and contributions to this project.
4-
We do have some guidelines to follow, covered in this document, but don't
5-
worry about (or expect to) get everything right the first time!
6-
Create a pull request and we'll nudge you in the right direction. Please also
7-
note that we have a [code of conduct](CODE_OF_CONDUCT.md) to make Cirq an
8-
open and welcoming community environment.
3+
We'd love to accept your patches and contributions to this project. We do have
4+
some guidelines to follow, covered in this document, but don't worry about –
5+
or expect toget everything right the first time! Create a pull request
6+
(discussed below) and we'll nudge you in the right direction. Please also note
7+
that we have a [code of conduct](CODE_OF_CONDUCT.md) to make Cirq an open and
8+
welcoming community environment.
99

1010
## Contributor License Agreement
1111

@@ -30,26 +30,32 @@ information on using pull requests.
3030
The preferred manner for submitting pull requests is for developers to fork
3131
the Cirq [repository](https://github.com/quantumlib/Cirq) and then use a [git
3232
branch](https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell)
33-
from this fork to create a pull request to the main Cirq repo. The basic process for setting
34-
up a fork is as follows:
35-
36-
1. Fork the Cirq repository (you can use the _Fork_ button in upper right
37-
corner of the [repository page](https://github.com/quantumlib/Cirq)).
38-
Forking creates a new GitHub repo at the location
39-
`https://github.com/USERNAME/Cirq`, where `USERNAME` is
40-
your GitHub user name. Use the instructions on the
41-
[development page](docs/dev/development.md) to download a copy to
42-
your local machine. You need only do this once.
43-
1. Check out the `main` branch and create a new branch from `main`:
33+
from this fork to create a pull request to the main Cirq repo. The basic
34+
process for setting up a fork is as follows:
35+
36+
1. Fork the Cirq repository (you can use the _Fork_ button in upper right
37+
corner of the [repository page](https://github.com/quantumlib/Cirq)).
38+
Forking creates a new GitHub repo at the location
39+
`https://github.com/USERNAME/Cirq`, where `USERNAME` is
40+
your GitHub user name. Use the instructions on the Cirq
41+
[development page](docs/dev/development.md) to download a copy to
42+
your local machine. You need only do this once.
43+
44+
1. Check out the `main` branch and create a new branch from `main`:
45+
4446
```shell
4547
git checkout main -b new_branch_name
4648
```
49+
4750
where `new_branch_name` is the name of your new branch.
48-
1. Do your work and commit your changes to this branch.
49-
1. If your local copy has drifted out of sync with the `main` branch of the
50-
main Cirq repo, you may need to merge in the latest changes. To do this,
51-
first update your local `main` and then merge your local `main`
52-
into your branch:
51+
52+
1. Do your work and commit your changes to this branch.
53+
54+
1. If your local copy has drifted out of sync with the `main` branch of the
55+
main Cirq repo, you may need to merge in the latest changes into your
56+
branch. To do this, first update your local `main` and then merge your
57+
local `main` into your branch:
58+
5359
```shell
5460
# Track the upstream repo (if your local repo hasn't):
5561
git remote add upstream https://github.com/quantumlib/Cirq.git
@@ -62,22 +68,26 @@ into your branch:
6268
git checkout new_branch_name
6369
git merge main
6470
```
71+
6572
You may need to fix [merge conflicts](
6673
https://docs.github.com/articles/about-merge-conflicts)
6774
during one or both of these merge processes.
68-
1. Finally, push your changes to your forked copy of the Cirq repo on GitHub:
75+
76+
1. Finally, push your changes to your forked copy of the Cirq repo on GitHub:
77+
6978
```shell
7079
git push origin new_branch_name
7180
```
72-
1. Now when you navigate to the Cirq repository on GitHub
73-
(https://github.com/quantumlib/Cirq),
74-
you should see the option to create a new pull request from
75-
your clone repository. Alternatively, you can create the pull request
76-
by navigating to the "Pull requests" tab in the page, and selecting
77-
the appropriate branches.
78-
1. A reviewer will comment on your code and may ask for changes.
79-
You can perform the necessary changes locally, and then push the new commit
80-
following the same process as above.
81+
82+
1. Now when you navigate to the Cirq repository on GitHub
83+
(https://github.com/quantumlib/Cirq), you should see the option to create a
84+
new pull request from your clone repository. Alternatively, you can create
85+
the pull request by navigating to the "Pull requests" tab near the top of
86+
the page, and selecting the appropriate branches.
87+
88+
1. A reviewer will comment on your code and may ask for changes. You can
89+
perform the necessary changes locally, and then push the new commit
90+
following the same process as above.
8191

8292
## Development Environment Setup
8393

@@ -97,28 +107,34 @@ integration checks locally.
97107
Please be aware of the following coding standards that will be applied to any
98108
new changes.
99109

100-
- **Tests**.
110+
### Tests
111+
101112
Existing tests must continue to pass (or be updated) when new changes are
102113
introduced. We use [pytest](https://docs.pytest.org) to run our
103114
tests.
104-
- **Coverage**.
105-
Code should be covered by tests.
106-
We use [pytest-cov](https://pytest-cov.readthedocs.io) to compute
107-
coverage, and custom tooling to filter down the output to only include new or
108-
changed code. We don't require 100% coverage, but any uncovered code must
109-
be annotated with `# pragma: no cover`. To ignore coverage of a single line,
110-
place `# pragma: no cover` at the end of the line. To ignore coverage for
111-
an entire block, start the block with a `# pragma: no cover` comment on its
112-
own line.
113-
- **Lint**.
115+
116+
### Coverage
117+
118+
Code should be covered by tests. We use
119+
[pytest-cov](https://pytest-cov.readthedocs.io) to compute coverage, and custom
120+
tooling to filter down the output to only include new or changed code. We don't
121+
require 100% coverage, but any uncovered code must be annotated with `# pragma:
122+
no cover`. To ignore coverage of a single line, place `# pragma: no cover` at
123+
the end of the line. To ignore coverage for an entire block, start the block
124+
with a `# pragma: no cover` comment on its own line.
125+
126+
### Lint
127+
114128
Code should meet common style standards for Python and be free of error-prone
115129
constructs. We use [Pylint](https://www.pylint.org/) to check for code lint.
116130
To see which lint checks we enforce, see the
117131
[dev_tools/conf/.pylintrc](dev_tools/conf/.pylintrc) file. When Pylint produces
118132
a false positive, it can be silenced with annotations. For example, the
119133
annotation `# pylint: disable=unused-import` would silence a warning about
120134
an unused import.
121-
- **Types**.
135+
136+
### Types
137+
122138
Code should have [type annotations](https://www.python.org/dev/peps/pep-0484/).
123139
We use [mypy](http://mypy-lang.org/) to check that type annotations are correct.
124140
When type checking produces a false positive, it can be silenced with
@@ -127,7 +143,7 @@ annotations such as `# type: ignore`.
127143
## Request For Comment Process for New Major Features
128144
129145
For larger contributions that will benefit from design reviews, please use the Cirq
130-
[Request for Comment](docs/dev/rfc_process.md) process.
146+
[Request for Comment](docs/dev/rfc_process.md) (RFC) process.
131147
132148
## Developing notebooks
133149

benchmarks/README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,36 @@
11
# Cirq Performance Benchmarks
2-
Performance benchmarking Cirq with [Airspeed Velocity](https://asv.readthedocs.io/en/stable/index.html).
2+
3+
This directory concerns doing Cirq performance benchmarks with [Airspeed
4+
Velocity](https://asv.readthedocs.io/en/stable/index.html).
35

46
## Overview
5-
The benchmark files (`bench_*.py`) stored in the current package (`benchmarks/*`) are used by asv to run benchmark tests for Cirq. For more information on how to write new benchmarks, please refer [Writing benchmarks guide by ASV](https://asv.readthedocs.io/en/stable/writing_benchmarks.html)
7+
8+
The benchmark files (`bench_*.py`) stored in the current package
9+
(`benchmarks/*`) are used by ASV to run benchmark tests for Cirq. For more
10+
information on how to write new benchmarks, please refer [Writing benchmarks
11+
guide by ASV](https://asv.readthedocs.io/en/stable/writing_benchmarks.html)
612

713
## Usage
8-
To run all benchmarks, navigate to the root Cirq directory at the command line and execute
14+
15+
To run all benchmarks, navigate to the root Cirq directory at the command line
16+
and execute the following command:
917

1018
```bash
1119
./check/asv_run
1220
```
1321

14-
You can also pass arguments to the script, which would be forwarded to the `asv run` command. For eg:
22+
You can also pass arguments to the `asv_run` script, which will be forwarded to
23+
the `asv run` command. Here's an example:
24+
1525
```bash
1626
./check/asv_run --quick --bench bench_examples --python 3.10
1727
```
1828

19-
Please refer [Running Benchmarks guide by ASV](https://asv.readthedocs.io/en/stable/using.html#running-benchmarks) for more information.
29+
Please refer to [Running Benchmarks guide by
30+
ASV](https://asv.readthedocs.io/en/stable/using.html#running-benchmarks) for
31+
more information.
2032

2133
## Results Database
22-
TODO([#3838](https://github.com/quantumlib/Cirq/issues/3838)): Add details regarding GCP setup.
34+
35+
TODO([#3838](https://github.com/quantumlib/Cirq/issues/3838)): Add details
36+
regarding GCP setup.
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
This folder contains test data for cirq's JSON serialization functionality.
1+
# JSON test data for Cirq serialization tests
22

3-
For more information, see [`docs/dev/serialization.md`](/docs/dev/serialization.md).
3+
This folder contains test data for Cirq's JSON serialization functionality. For
4+
more information, please see
5+
[`docs/dev/serialization.md`](/docs/dev/serialization.md).
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
# Device specifications of Google quantum processors
2+
13
This directory contains snapshots of `DeviceSpecification` proto messages
2-
(defined in `cirq-google/cirq_google/api/v2/device.proto`) describing Google devices.
4+
(defined in `cirq-google/cirq_google/api/v2/device.proto`) describing Google
5+
devices.
36

4-
Files with the suffix `_for_grid_device` are equivalent representations of corresponding proto files
5-
without the suffix, but in the new `DeviceSpecification` format which is parsed into
6-
`cirq_google.GridDevice`.
7+
Files with the suffix `_for_grid_device` are equivalent representations of
8+
corresponding proto files without the suffix, but in the new
9+
`DeviceSpecification` format which is parsed into `cirq_google.GridDevice`.

cirq-google/version_policy.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# cirq-google Version Policy
22

3-
The `cirq-google` directory should abide by Semantic Versioning 2.0.0. In rare cases, we may introduce backward-incompatible changes to the public API in a release with a minor version increment. Such changes will be noted in `CHANGELOG.md` within the directory before the release.
3+
The `cirq-google` directory should abide by the [Semantic Versioning
4+
2.0.0](https://semver.org/) principles. In rare cases, we may introduce
5+
backward-incompatible changes to the public API in a release with a minor
6+
version increment. Such changes will be noted in `CHANGELOG.md` within the
7+
directory before the release.

0 commit comments

Comments
 (0)