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: contribute/hacker-guide.md
+22-23Lines changed: 22 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -182,7 +182,7 @@ Here are also some tips & tricks that have proven useful in Scala development:
182
182
* If after introducing changes or updating your clone, you get `AbstractMethodError` or other linkage exceptions,
183
183
try doing `ant clean build`. Due to the way how Scala compiles traits, if a trait changes, then it's sometimes not enough to recompile
184
184
just that trait, but it might also be necessary to recompile its users. The `ant` tool is not smart enough to do that, which might lead to
185
-
very strange errors. Fullrebuilds fix the problem. Fortunately that's rarely necessary, because fullrebuilds take a lot of time-- the same 8-30 minutes as mentioned above.
185
+
very strange errors. Full-rebuilds fix the problem. Fortunately that's rarely necessary, because full-rebuilds take a lot of time-- the same 8-30 minutes as mentioned above.
186
186
* Even on solid state drives packaging Scala distribution (i.e. creating jars from class files) is a non-trivial task. To save time here,
187
187
some people in our team do `ant quick.comp` instead of `ant` and then create custom scripts to launch Scala from `build/quick/classes`.
188
188
* Don't underestimate the power of `print`. When starting with Scala, I spent a lot of time in the debugger trying to figure out how
@@ -220,10 +220,10 @@ Documentation about the internal workings of the Scala compiler is scarce, and m
220
220
221
221
Tools like Scaladoc also welcome contributions. Unfortunately these smaller projects have less developer documentation. In these cases, the best thing to do is to directly explore the code base (which often contains documentation as inline comments) or to write to the appropriate maintainers for pointers.
222
222
223
-
### Interlude ###
223
+
### Interlude
224
224
225
-
To fix [the bug I'm interested in](https://issues.scala-lang.org/browse/SI-6725) I've tracked the `StringContext.f` interpolator
226
-
down to a macro implemented in `MacroImplementations.scala`. There I noticed that the interpolator only processes conversions,
225
+
To fix [the bug we're interested in](https://issues.scala-lang.org/browse/SI-6725). Let's say we've tracked the `StringContext.f` interpolator
226
+
down to a macro implemented in `MacroImplementations.scala`, and there we notice that the interpolator only processes conversions,
@@ -242,7 +242,7 @@ but not tokens like `%n`. Looks like an easy fix.
242
242
start = idx + 1
243
243
}
244
244
245
-
After I applied the fix and running `ant`, my simple test case in `sandbox/Test.scala` started working!
245
+
After applying the fix and running `ant`, our simple test case in `sandbox/Test.scala` started working!
246
246
247
247
18:51 ~/Projects/scala/sandbox (ticket/6725)$ cd ..
248
248
18:51 ~/Projects/scala (ticket/6725)$ ant
@@ -266,7 +266,7 @@ After I applied the fix and running `ant`, my simple test case in `sandbox/Test.
266
266
1
267
267
1 // no longer getting the %n here - it got transformed into a newline
268
268
269
-
### Verify ###
269
+
### Verify
270
270
271
271
Now to make sure that my fix doesn't break anything I need to run the test suite using the `partest` tool we wrote to test Scala.
272
272
Read up [the partest guide](/contribute/partest-guide.html) to learn the details about partest, but in a nutshell you can either
@@ -283,26 +283,25 @@ run `ant test` to go through the entire test suite (30+ minutes) or use wildcard
283
283
testing: [...]/files/run/stringinterpolation_macro-run.scala [ OK ]
284
284
All of 6 tests were successful (elapsed time: 00:00:08)
285
285
286
-
###4. Publish ###
286
+
## 4. Publish
287
287
288
288
After development is finished, it's time to publish the code and submit your patch for discussion and potential inclusion into Scala.
289
-
In a nutshell this involves: 1) making sure that your code and commit messages are of high quality, 2) clicking a few buttons in the
290
-
Github interface, 3) assigning one or more reviewers which will look through your pull request. Now all that in more details.
289
+
In a nutshell, this involves:
291
290
292
-
### Commit ###
291
+
1. making sure that your code and commit messages are of high quality,
292
+
2. clicking a few buttons in the Github interface,
293
+
3. assigning one or more reviewers which will look through your pull request.
294
+
295
+
Let's go into each of these points in more detail.
296
+
297
+
### Commit
293
298
294
299
The [Git Basics](http://git-scm.com/book/en/Git-Basics) chapter in the Git online book covers most of the basic workflow during this stage.
295
300
There are two things you should know here:
296
301
297
-
1) Commit messages are frequently the only way to communicate with the authors of the code written a few years ago. Therefore, we give them
298
-
big importance. Be creative and eloquent - the more context your provide for the change you've introduced, the bigger the probability that
299
-
some future maintainer will get you right. Consult [the pull request policy](https://github.com/scala/scala/wiki/Pull-Request-Policy)
300
-
for more information about the desired style of your commits.
302
+
1. Commit messages are often the only way to understand the intentions of authors of code written a few years ago. Thus, writing a quality is of utmost importance. The more context you provide for the change you've introduced, the larger the chance that some future maintainer understand your intentions. Consult [the pull request policy](https://github.com/scala/scala/wiki/Pull-Request-Policy) for more information about the desired style of your commits.
301
303
302
-
2) Clean history is also important. Therefore we won't accept pull requests for bug fixes that have more than one commit.
303
-
For features, it is okay to have several commits, but all tests need to pass after every single commit. To clean up your commit structure,
304
-
you want to [rewrite history](http://git-scm.com/book/en/Git-Branching-Rebasing) using `git rebase` so that your commits are against
305
-
the latest revision of `master`.
304
+
2. Keeping Scala's git history clean is also important. Therefore we won't accept pull requests for bug fixes that have more than one commit. For features, it is okay to have several commits, but all tests need to pass after every single commit. To clean up your commit structure, you want to [rewrite history](http://git-scm.com/book/en/Git-Branching-Rebasing) using `git rebase` so that your commits are against the latest revision of `master`.
306
305
307
306
Once you are satisfied with your work, synced with `master` and cleaned up your commits you are ready to submit a patch to the central Scala repository. Before proceeding make sure you have pushed all of your local changes to your fork on Github.
308
307
@@ -321,18 +320,18 @@ Once you are satisfied with your work, synced with `master` and cleaned up your
321
320
To https://github.com/xeno-by/scala
322
321
* [new branch] ticket/6725 -> ticket/6725
323
322
324
-
### Submit ###
323
+
### Submit
325
324
326
-
This part is very easy and enjoyable. Navigate to your branch in Github (for me it was `https://github.com/xeno-by/scala/tree/ticket/6725`)
325
+
Now, we must simply submit our proposed patch. Navigate to your branch in Github (for me it was `https://github.com/xeno-by/scala/tree/ticket/6725`)
327
326
and click the pull request button to submit your patch as a pull request to Scala. If you've never submitted patches to Scala, you will
328
327
need to sign the contributor license agreement, which [can be done online](http://typesafe.com/contribute/cla/scala) within a few minutes.
329
328
330
329
<center><imgsrc="{{ site.baseurl }}/resources/img/04-submit.png"alt="Submit a pull request" /></center>
331
330
332
-
### Discuss ###
331
+
### Discuss
333
332
334
-
After the pull request has been submitted, you need to pick a reviewer (probably, the person you've contacted in the beginning of your
335
-
workflow) and be ready to elaborate and adjust your patch if necessary. I picked Martin, because we had such a nice chat on the mailing list:
333
+
After the pull request has been submitted, you need to pick a reviewer (usually the person you've contacted in the beginning of your
334
+
workflow) and be ready to elaborate and adjust your patch if necessary. In this example, we picked Martin, because we had such a nice chat on the mailing list:
336
335
337
336
<center><imgsrc="{{ site.baseurl }}/resources/img/05-review.png"alt="SAssign the reviewer" /></center>
0 commit comments