summary refs log tree commit diff stats
path: root/doc
diff options
context:
space:
mode:
authorSimon Hafner <hafnersimon@gmail.com>2015-06-25 16:39:27 -0500
committerSimon Hafner <hafnersimon@gmail.com>2015-06-25 16:40:47 -0500
commit57964a0ef2da9457783f6a4ea728dcea80df9a12 (patch)
treedaf972ba2b8c735a4d4c4f8b77910234a92398ef /doc
parent6109e6a999c0f70b22e84b5ac412f97efc153367 (diff)
downloadNim-57964a0ef2da9457783f6a4ea728dcea80df9a12.tar.gz
moved contributing guide back to root
"I don't want symlinks, symlinks suck, they turn an acylic tree into an acyclic graph."
Diffstat (limited to 'doc')
-rw-r--r--doc/contributing.rst166
1 files changed, 0 insertions, 166 deletions
diff --git a/doc/contributing.rst b/doc/contributing.rst
deleted file mode 100644
index 10f779cc1..000000000
--- a/doc/contributing.rst
+++ /dev/null
@@ -1,166 +0,0 @@
-Writing tests
-=============
-
-Not all the tests follow this scheme, feel free to change the ones
-that don't. Always leave the code cleaner than you found it.
-
-Stdlib
-------
-
-If you change the stdlib (anything under ``lib/``), put a test in the
-file you changed. Add the tests under an ``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
-each has its own scope. Use boolean conditions and ``doAssert`` for the
-testing by itself, don't rely on echo statements or similar.
-
-Sample test:
-
-.. code-block:: nim
-
-  when isMainModule:
-    block: # newSeqWith tests
-      var seq2D = newSeqWith(4, newSeq[bool](2))
-      seq2D[0][0] = true
-      seq2D[1][0] = true
-      seq2D[0][1] = true
-      doAssert seq2D == @[@[true, true], @[true, false],
-                          @[false, false], @[false, false]]
-
-Compiler
---------
-
-The tests for the compiler work differently, they are all located in
-``tests/``. Each test has its own file, which is different from the
-stdlib tests. At the beginning of every test is the expected side of
-the test. Possible keys are:
-
-- output: The expected output, most likely via ``echo``
-- exitcode: Exit code of the test (via ``exit(number)``)
-- errormsg: The expected error message
-- file: The file the errormsg
-- line: The line the errormsg was produced at
-
-An example for a test:
-
-.. code-block:: nim
-
-  discard """
-    errormsg: "type mismatch: got (PTest)"
-  """
-
-  type
-    PTest = ref object
-
-  proc test(x: PTest, y: int) = nil
-
-  var buf: PTest
-  buf.test()
-
-Running tests
-=============
-
-You can run the tests with
-
-::
-  ./koch tests
-
-which will run a good subset of tests. Some tests may fail. If you
-only want to see the output of failing tests, go for
-
-::
-  ./koch tests --failing all
-
-You can also run only a single category of tests. A category is a subdirectory
-in the ``tests`` directory. There are a couple of special categories; for a
-list of these, see ``tests/testament/categories.nim``, at the bottom.
-
-::
-  ./koch tests c lib
-
-Comparing tests
-===============
-
-Because some tests fail in the current ``devel`` branch, not every fail
-after your change is necessarily caused by your changes.
-
-The tester can compare two test runs. First, you need to create the
-reference test. You'll also need to the commit id, because that's what
-the tester needs to know in order to compare the two.
-
-::
-  git checkout devel
-  DEVEL_COMMIT=$(git rev-parse HEAD)
-  ./koch tests
-
-Then switch over to your changes and run the tester again.
-
-::
-  git checkout your-changes
-  ./koch tests
-
-Then you can ask the tester to create a ``testresults.html`` which will
-tell you if any new tests passed/failed.
-
-::
-  ./koch --print html $DEVEL_COMMIT
-
-
-Deprecation
-===========
-
-Backward compatibility is important, so if you are renaming a proc or
-a type, you can use
-
-
-.. code-block:: nim
-
-  {.deprecated: [oldName: new_name].}
-
-Or you can simply use
-
-.. code-block:: nim
-
-  proc oldProc() {.deprecated.}
-
-to mark a symbol as deprecated. Works for procs/types/vars/consts,
-etc. Note that currently the ``deprecated`` statement does not work well with
-overloading so for routines the latter variant is better.
-
-
-`Deprecated <http://nim-lang.org/docs/manual.html#pragmas-deprecated-pragma>`_
-pragma in the manual.
-
-
-
-The Git stuff
-=============
-
-General commit rules
---------------------
-
-1. All changes introduced by the commit (diff lines) must be related to the
-   subject of the commit.
-
-   If you change some other unrelated to the subject parts of the file, because
-   your editor reformatted automatically the code or whatever different reason,
-   this should be excluded from the commit.
-
-   *Tip:* Never commit everything as is using ``git commit -a``, but review
-   carefully your changes with ``git add -p``.
-
-2. Changes should not introduce any trailing whitespace.
-
-   Always check your changes for whitespace errors using ``git diff --check``
-   or add following ``pre-commit`` hook:
-
-   .. code-block:: sh
-
-      #!/bin/sh
-      git diff --check --cached || exit $?
-
-   No sane programming or markup language cares about trailing whitespace, so
-   tailing whitespace is just a noise you should not introduce to the
-   repository.
-
-3. Describe your commit and use your common sense.
n375'>375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 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 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778