You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/en/community/contribute/code.md
+68-31Lines changed: 68 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,10 +6,20 @@ you get started. Thank you for work and interest in improving TensorFlow.
6
6
7
7
## Before you get started
8
8
9
-
Before you contribute source code to a TensorFlow project, please review the `CONTRIBUTING.md` file in the GitHub repo of the project. (For example, see the
10
-
[CONTRIBUTING.md file for the core TensorFlow repo](https://github.com/tensorflow/tensorflow/blob/master/CONTRIBUTING.md).) All code contributors are required to sign a [Contributor License Agreement](https://cla.developers.google.com/clas) (CLA).
11
-
12
-
To avoid duplicating work, please review [current](https://github.com/tensorflow/community/tree/master/rfcs) or [proposed](https://github.com/tensorflow/community/labels/RFC%3A%20Proposed) RFCs and contact the developers on the TensorFlow forums ([[email protected]](https://groups.google.com/u/1/a/tensorflow.org/g/developers)) before you start work on a non-trivial feature. We are somewhat selective when deciding to add new functionality, and the best way to contribute and help the project is to work on known issues.
9
+
Before you contribute source code to a TensorFlow project, please review the
10
+
`CONTRIBUTING.md` file in the GitHub repo of the project. For example, see the
If you are interested in recruiting a team to help tackle a large-scale problem or a new feature, please email the [developers@ group](https://groups.google.com/a/tensorflow.org/forum/#!forum/developers) and review our current list of RFCs.
26
-
35
+
If you are interested in recruiting a team to help tackle a large-scale problem
New features, bug fixes, and any other changes to the code base are subject to code review.
42
+
New features, bug fixes, and any other changes to the code base are subject to
43
+
code review.
31
44
32
-
Reviewing code contributed to the project as pull requests is a crucial component of TensorFlow development. We encourage anyone to start reviewing code submitted by other developers, especially if the feature is something that you are likely to use.
45
+
Reviewing code contributed to the project as pull requests is a crucial
46
+
component of TensorFlow development. We encourage anyone to start reviewing code
47
+
submitted by other developers, especially if the feature is something that you
48
+
are likely to use.
33
49
34
50
Here are some questions to keep in mind during the code review process:
35
51
@@ -44,36 +60,47 @@ Here are some questions to keep in mind during the code review process:
44
60
45
61
## Test and improve test coverage
46
62
47
-
High-quality unit testing is a corner-stone of the TensorFlow development process. For this purpose, we use Docker images. The test functions are appropriately named, and are responsible for checking the validity of algorithms as well as different options of the code.
63
+
High-quality unit testing is a corner-stone of the TensorFlow development
64
+
process. For this purpose, we use Docker images. The test functions are
65
+
appropriately named, and are responsible for checking the validity of algorithms
66
+
as well as different options of the code.
48
67
49
-
All new features and bug fixes *must* include adequate test coverage. We also welcome contributions of new test cases or improvements to existing tests. If you discover that our existing tests are not complete — even if that is not currently causing a bug — please file an issue and, if possible, a pull request.
68
+
All new features and bug fixes *must* include adequate test coverage. We also
69
+
welcome contributions of new test cases or improvements to existing tests. If
70
+
you discover that our existing tests are not complete — even if that is not
71
+
currently causing a bug — please file an issue and, if possible, a pull request.
50
72
51
-
For the specific details of testing procedures in each TensorFlow project, see the `README.md` and `CONTRIBUTING.md` files in the project repo on GitHub.
73
+
For the specific details of testing procedures in each TensorFlow project, see
74
+
the `README.md` and `CONTRIBUTING.md` files in the project repo on GitHub.
52
75
53
76
Of particular concerns in *adequate testing*:
54
77
55
-
* Is *every public function and class* tested?
56
-
* Are a *reasonable set of parameters*, their values, value types, and combinations tested?
57
-
* Do the tests validate that the *code is correct*, and that it is *doing what the documentation says* the code is intended to do?
78
+
* Is *every public function and class* tested?
79
+
* Are a *reasonable set of parameters*, their values, value types, and
80
+
combinations tested?
81
+
* Do the tests validate that the *code is correct*, and that it is *doing what
82
+
the documentation says* the code is intended to do?
58
83
* If the change is a bug fix, is a *non-regression test* included?
59
84
* Do the tests *pass the continuous integration* build?
60
-
* Do the tests *cover every line of code?* If not, are the exceptions reasonable and explicit?
61
-
62
-
If you find any problems, please consider helping the contributor understand those problems and resolve them.
85
+
* Do the tests *cover every line of code?* If not, are the exceptions
86
+
reasonable and explicit?
63
87
88
+
If you find any problems, please consider helping the contributor understand
89
+
those problems and resolve them.
64
90
65
91
## Improve error messages or logs
66
92
67
-
We welcome contributions that improve error messages and logging.
68
-
93
+
We welcome contributions that improve error messages and logging.
69
94
70
95
## Contribution workflow
71
96
72
-
Code contributions—bug fixes, new development, test improvement—all follow a GitHub-centered workflow. To participate in TensorFlow development, set up a GitHub account. Then:
97
+
Code contributions—bug fixes, new development, test improvement—all follow a
98
+
GitHub-centered workflow. To participate in TensorFlow development, set up a
99
+
GitHub account. Then:
73
100
74
-
1. Fork the repo you plan to work on.
75
-
Go to the project repo page and use the *Fork* button. This will create a copy of the
76
-
repo, under your username. (For more details on how to fork a repository see
101
+
1. Fork the repo you plan to work on. Go to the project repo page and use the
102
+
*Fork* button. This will create a copy of the repo, under your username.
@@ -96,29 +123,39 @@ Code contributions—bug fixes, new development, test improvement—all follow a
96
123
97
124
`$ git push origin branch-name`
98
125
99
-
7. Open a *Pull Request* (PR). Go to the original project repo on GitHub. There will be a message about your recently pushed branch, asking if you would like to open a pull request. Follow the prompts, *compare across repositories*, and submit the PR. This will send an email to the committers. You may want to consider sending an email to the mailing list for more visibility. (For more details, see the [GitHub guide on PRs](https://help.github.com/articles/creating-a-pull-request-from-a-fork).
126
+
7. Open a *Pull Request* (PR). Go to the original project repo on GitHub. There
127
+
will be a message about your recently pushed branch, asking if you would
128
+
like to open a pull request. Follow the prompts, *compare across
129
+
repositories*, and submit the PR. This will send an email to the committers.
130
+
You may want to consider sending an email to the mailing list for more
131
+
visibility. (For more details, see the
132
+
[GitHub guide on PRs](https://help.github.com/articles/creating-a-pull-request-from-a-fork).
100
133
101
-
8. Maintainers and other contributors will *review your PR*. Please participate in the conversation, and try to *make any requested changes*. Once the PR is approved, the code will be merged.
134
+
8. Maintainers and other contributors will *review your PR*. Please participate
135
+
in the conversation, and try to *make any requested changes*. Once the PR is
136
+
approved, the code will be merged.
102
137
103
-
*Before working on your next contribution*, make sure your local repository is up to date.
138
+
*Before working on your next contribution*, make sure your local repository is
139
+
up to date.
104
140
105
-
1. Set the upstream remote. (You only have to do this once per project, not every time.)
141
+
1. Set the upstream remote. (You only have to do this once per project, not
0 commit comments