Skip to content

Commit c7a80f0

Browse files
committed
Final tweaks to the hacker guide. Mostly wording
1 parent 91e4191 commit c7a80f0

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

contribute/hacker-guide.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Here are also some tips & tricks that have proven useful in Scala development:
182182
* If after introducing changes or updating your clone, you get `AbstractMethodError` or other linkage exceptions,
183183
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
184184
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. 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.
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.
186186
* Even on solid state drives packaging Scala distribution (i.e. creating jars from class files) is a non-trivial task. To save time here,
187187
some people in our team do `ant quick.comp` instead of `ant` and then create custom scripts to launch Scala from `build/quick/classes`.
188188
* 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
220220

221221
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.
222222

223-
### Interlude ###
223+
### Interlude
224224

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,
227227
but not tokens like `%n`. Looks like an easy fix.
228228

229229
18:44 ~/Projects/scala/sandbox (ticket/6725)$ git diff
@@ -242,7 +242,7 @@ but not tokens like `%n`. Looks like an easy fix.
242242
start = idx + 1
243243
}
244244

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!
246246

247247
18:51 ~/Projects/scala/sandbox (ticket/6725)$ cd ..
248248
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.
266266
1
267267
1 // no longer getting the %n here - it got transformed into a newline
268268

269-
### Verify ###
269+
### Verify
270270

271271
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.
272272
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
283283
testing: [...]/files/run/stringinterpolation_macro-run.scala [ OK ]
284284
All of 6 tests were successful (elapsed time: 00:00:08)
285285

286-
### 4. Publish ###
286+
## 4. Publish
287287

288288
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:
291290

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
293298

294299
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.
295300
There are two things you should know here:
296301

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.
301303

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`.
306305

307306
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.
308307

@@ -321,18 +320,18 @@ Once you are satisfied with your work, synced with `master` and cleaned up your
321320
To https://github.com/xeno-by/scala
322321
* [new branch] ticket/6725 -> ticket/6725
323322

324-
### Submit ###
323+
### Submit
325324

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`)
327326
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
328327
need to sign the contributor license agreement, which [can be done online](http://typesafe.com/contribute/cla/scala) within a few minutes.
329328

330329
<center><img src="{{ site.baseurl }}/resources/img/04-submit.png" alt="Submit a pull request" /></center>
331330

332-
### Discuss ###
331+
### Discuss
333332

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:
336335

337336
<center><img src="{{ site.baseurl }}/resources/img/05-review.png" alt="SAssign the reviewer" /></center>
338337

0 commit comments

Comments
 (0)