summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
authornarimiran <narimiran@disroot.org>2019-06-17 12:15:47 +0200
committernarimiran <narimiran@disroot.org>2019-06-17 12:15:47 +0200
commitb70fd0400eb976b7e1e60845b2bfe0bdb5bf137e (patch)
treefa80f4ae42768c3e2c5f3b09a05769d95919ef18 /doc
parenteb087b35469e17b957cee18c3b988c40884bd35e (diff)
downloadNim-b70fd0400eb976b7e1e60845b2bfe0bdb5bf137e.tar.gz
[other] introduce a separate changelog for backports, update
contributing guidelines
Diffstat (limited to 'doc')
-rw-r--r--doc/contributing.rst57
1 files changed, 33 insertions, 24 deletions
diff --git a/doc/contributing.rst b/doc/contributing.rst
index 317fe3ab7..6d13fd595 100644
--- a/doc/contributing.rst
+++ b/doc/contributing.rst
@@ -26,7 +26,7 @@ There are 3 types of tests:
 2. tests in ``when isMainModule:`` block, ran by ``nim c mymod.nim``
    ``nimble test`` also typially runs these in external nimble packages.
 
-3. testament tests, eg: ``tests/stdlib/tos.nim`` (only used for Nim repo).
+3. testament tests, e.g.: ``tests/stdlib/tos.nim`` (only used for Nim repo).
 
 Not all the tests follow the convention here, feel free to change the ones
 that don't. Always leave the code cleaner than you found it.
@@ -34,7 +34,7 @@ that don't. Always leave the code cleaner than you found it.
 Stdlib
 ------
 
-If you change the stdlib (anything under ``lib/``, eg ``lib/pure/os.nim``),
+If you change the stdlib (anything under ``lib/``, e.g. ``lib/pure/os.nim``),
 put a test in the file you changed. Add the tests under a ``when isMainModule:``
 condition so they only get executed when the tester is building the
 file. Each test should be in a separate ``block:`` statement, such that
@@ -57,7 +57,7 @@ Sample test:
       doAssert not (1 == 2)
 
 Newer tests tend to be run via ``testament`` rather than via ``when isMainModule:``,
-eg ``tests/stdlib/tos.nim``; this allows additional features such as custom
+e.g. ``tests/stdlib/tos.nim``; this allows additional features such as custom
 compiler flags; for more details see below.
 
 Compiler
@@ -96,6 +96,7 @@ An example for a test:
   var buf: PTest
   buf.test()
 
+
 Running tests
 =============
 
@@ -125,16 +126,17 @@ To run a single test:
 
 ::
 
-  ./koch test run <category>/<name>    # eg: tuples/ttuples_issues
+  ./koch test run <category>/<name>    # e.g.: tuples/ttuples_issues
   ./koch test run tests/stdlib/tos.nim # can also provide relative path
 
 For reproducible tests (to reproduce an environment more similar to the one
 run by Continuous Integration on travis/appveyor), you may want to disable your
-local configuration (eg in ``~/.config/nim/nim.cfg``) which may affect some
+local configuration (e.g. in ``~/.config/nim/nim.cfg``) which may affect some
 tests; this can also be achieved by using
 ``export XDG_CONFIG_HOME=pathtoAlternateConfig`` before running ``./koch``
 commands.
 
+
 Comparing tests
 ===============
 
@@ -177,7 +179,8 @@ the old name and introduce a new name:
 .. code-block:: nim
 
   # for routines (proc/template/macro/iterator) and types:
-  proc oldProc() {.deprecated: "use `newImpl: string -> int` instead".} = discard
+  proc oldProc(a: int, b: float): bool {.deprecated:
+      "deprecated since v1.2.3; use `newImpl: string -> int` instead".} = discard
 
   # for (const/var/let/fields) the msg is not yet supported:
   const Foo {.deprecated.}  = 1
@@ -263,6 +266,7 @@ or
 
 the first is preferred.
 
+
 Best practices
 =============
 
@@ -309,7 +313,7 @@ which for which ``nim doc`` ignores ``-d:release``).
 
 .. _delegate_printing:
 Delegate printing to caller: return ``string`` instead of calling ``echo``
-rationale: it's more flexible (eg allows caller to call custom printing,
+rationale: it's more flexible (e.g. allows caller to call custom printing,
 including prepending location info, writing to log files, etc).
 
 .. code-block:: nim
@@ -319,7 +323,7 @@ including prepending location info, writing to log files, etc).
 
 .. _use_Option:
 [Ongoing debate] Consider using Option instead of return bool + var argument,
-unless stack allocation is needed (eg for efficiency).
+unless stack allocation is needed (e.g. for efficiency).
 
 .. code-block:: nim
 
@@ -337,6 +341,7 @@ https://github.com/nim-lang/Nim/pull/9335 and https://forum.nim-lang.org/t/4089
   echo foo() # adds a line for testament in `output:` block inside `discard`.
   doAssert foo() == [1, 2] # preferred, except when not possible to do so.
 
+
 The Git stuff
 =============
 
@@ -348,7 +353,11 @@ General commit rules
    are backported to the latest stable release branch (currently 0.20.x).
    Refactorings are backported because they often enable further bugfixes.
 
-2. All changes introduced by the commit (diff lines) must be related to the
+2. If you introduce changes which affect backwards compatibility,
+   make breaking changes, or have PR which is tagged as ``[feature]``,
+   the changes should be mentioned in `<changelog.md>`_.
+
+3. All changes introduced by the commit (diff lines) must be related to the
    subject of the commit.
 
    If you change something unrelated to the subject parts of the file, because
@@ -358,7 +367,7 @@ General commit rules
    *Tip:* Never commit everything as is using ``git commit -a``, but review
    carefully your changes with ``git add -p``.
 
-3. Changes should not introduce any trailing whitespace.
+4. Changes should not introduce any trailing whitespace.
 
    Always check your changes for whitespace errors using ``git diff --check``
    or add following ``pre-commit`` hook:
@@ -368,26 +377,26 @@ General commit rules
       #!/bin/sh
       git diff --check --cached || exit $?
 
-4. Describe your commit and use your common sense.
+5. Describe your commit and use your common sense.
+   Example commit message:
 
-   Example Commit messages: ``Fixes #123; refs #124``
+   ``Fixes #123; refs #124``
 
    indicates that issue ``#123`` is completely fixed (github may automatically
    close it when the PR is committed), wheres issue ``#124`` is referenced
-   (eg: partially fixed) and won't close the issue when committed.
+   (e.g.: partially fixed) and won't close the issue when committed.
 
-5. Commits should be always be rebased against devel (so a fast forward
+6. Commits should be always be rebased against devel (so a fast forward
    merge can happen)
 
-   eg: use ``git pull --rebase origin devel``. This is to avoid messing up
-   git history, see `#8664 <https://github.com/nim-lang/Nim/issues/8664>`_ .
+   e.g.: use ``git pull --rebase origin devel``. This is to avoid messing up
+   git history.
    Exceptions should be very rare: when rebase gives too many conflicts, simply
    squash all commits using the script shown in
    https://github.com/nim-lang/Nim/pull/9356
 
-
-6. Do not mix pure formatting changes (eg whitespace changes, nimpretty) or
-   automated changes (eg nimfix) with other code changes: these should be in
+7. Do not mix pure formatting changes (e.g. whitespace changes, nimpretty) or
+   automated changes (e.g. nimfix) with other code changes: these should be in
    separate commits (and the merge on github should not squash these into 1).
 
 
@@ -395,11 +404,11 @@ Continuous Integration (CI)
 ---------------------------
 
 1. Continuous Integration is by default run on every push in a PR; this clogs
-   the CI pipeline and affects other PR's; if you don't need it (eg for WIP or
+   the CI pipeline and affects other PR's; if you don't need it (e.g. for WIP or
    documentation only changes), add ``[ci skip]`` to your commit message title.
-   This convention is supported by `Appveyor <https://www.appveyor.com/docs/how-to/filtering-commits/#skip-directive-in-commit-message>`_
-   and `Travis <https://docs.travis-ci.com/user/customizing-the-build/#skipping-a-build>`_
-
+   This convention is supported by `Appveyor
+   <https://www.appveyor.com/docs/how-to/filtering-commits/#skip-directive-in-commit-message>`_
+   and `Travis <https://docs.travis-ci.com/user/customizing-the-build/#skipping-a-build>`_.
 
 2. Consider enabling CI (travis and appveyor) in your own Nim fork, and
    waiting for CI to be green in that fork (fixing bugs as needed) before
@@ -424,7 +433,7 @@ Code reviews
       git show --color-moved-ws=allow-indentation-change --color-moved=blocks HEAD^
 
 3. In addition, you can view github-like diffs locally to identify what was changed
-   within a code block using `diff-highlight` or `diff-so-fancy`, eg:
+   within a code block using `diff-highlight` or `diff-so-fancy`, e.g.:
 
    .. code-block:: sh
 
a> 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668