Skip to content

Commit 035a299

Browse files
committed
Update advice on bug references
1 parent c15d170 commit 035a299

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

CONTRIBUTING.md

+16-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ The kind of code we can accept depends on the life cycle for the release you're
3636

3737
#### Bug Fix
3838

39-
At the end of the commit message, include "Fixes scala/bug#NNNN", where https://github.com/scala/bug/issues/NNNN tracks the bug you're fixing. We also recommend naming your branch after the ticket number.
39+
At the end of the PR description, which is autofilled with the commit message if there is only one commit, add the phrase, "Fixes scala/bug#NNNN", where `https://github.com/scala/bug/issues/NNNN` tracks the bug you're fixing. Github will turn your bug number into a link.
40+
41+
We also recommend naming your branch after the ticket number.
4042

4143
Please make sure the ticket's milestone corresponds to the upcoming milestone for the branch your PR targets. The CI automation will automatically assign the milestone after you open the PR.
4244

@@ -113,8 +115,14 @@ To run a single negative test from sbt shell:
113115
root> partest --verbose test/files/neg/delayed-init-ref.scala
114116
```
115117

116-
To specify specific flags such as `-deprecation -Xlint -Xfatal-warnings`, you can put them in
117-
`test/files/neg/<test>.flags`. This could be used to test specific behavior under `-deprecation` flag etc.
118+
To specify compiler flags such as `-deprecation -Xlint -Xfatal-warnings`, you can add a comment
119+
at the top of your source file of the form: `// scalac: -deprecation -Xlint -Xfatal-warnings`.
120+
121+
To test that no warnings are emitted, use `-Xfatal-warnings`. That will fail a `pos` test if there
122+
are warnings. Note that `pos` tests do not have `.check` files.
123+
124+
To test that warnings are correctly emitted, use `-Xfatal-warnings` with a `neg` test and `.check` file.
125+
The usual way to create a `.check` file is `partest --update-check`.
118126

119127
To run all tests in `neg` categories from sbt shell:
120128

@@ -154,8 +162,8 @@ root> partest --help
154162
Partests are compiled by the `quick` compiler (and `run` partests executed with the `quick` library),
155163
and therefore:
156164

157-
* if you're working in the compiler, you must write a partest, or a `BytecodeTest` JUnit test which invokes the compiler programmatically; however
158-
* if you're working in the library, a JUnit and/or ScalaCheck is better.
165+
* if you're working on the compiler, you must write a partest, or a `BytecodeTest` JUnit test which invokes the compiler programmatically; however
166+
* if you're working on the library, a JUnit and/or ScalaCheck is better.
159167

160168
#### exploring with REPL
161169

@@ -213,7 +221,9 @@ by the commit on the code base, so use the active voice and the
213221
present tense. That also makes the commit subjects easy to reuse in
214222
release notes.
215223

216-
For a bugfix, the end of the commit message should say "Fixes scala/bug#NNNN".
224+
For a bugfix, the end of the PR description (that is, the first comment on the PR) should say, "Fixes scala/bug#NNNN", as mentioned above.
225+
226+
NOTE: it's best not to add the issue reference to your commit message, as github will pollute the conversation on the ticket with notifications every time you commit.
217227

218228
If a commit purely refactors and is not intended to change behaviour,
219229
say so.

0 commit comments

Comments
 (0)