summary refs log tree commit diff stats
path: root/doc/nimfix.rst
blob: 62064fe69b41646fb57c88d4b9f7a66f64daf3af (plain) (blame)
1
2
3
4
5
6
7
8
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted
=====================
  Nimfix User Guide
=====================

:Author: Andreas Rumpf
:Version: |nimversion|

**WARNING**: Nimfix is currently beta-quality.

Nimfix is a tool to help you upgrade from Nimrod (<= version 0.9.6) to
Nim (=> version 0.10.0).

It performs 3 different actions:

1. It makes your code case consistent.
2. It renames every symbol that has a deprecation rule. So if a module has a
   rule ``{.deprecated: [TFoo: Foo].}`` then ``TFoo`` is replaced by ``Foo``.
3. It can also check that your identifiers adhere to the official style guide
   and optionally modify them to do so (via ``--styleCheck:auto``).

Note that ``nimfix`` defaults to **overwrite** your code unless you
use ``--overwriteFiles:off``! But hey, if you do not use a version control
system by this day and age, your project is already in big trouble.


Installation
------------

Nimfix is part of the compiler distribution. Compile via::

  nim c compiler/nimfix/nimfix.nim
  mv compiler/nimfix/nimfix bin

Or on windows::

  nim c compiler\nimfix\nimfix.nim
  move compiler\nimfix\nimfix.exe bin

Usage
-----

Usage:
  nimfix [options] projectfile.nim

Options:

  --overwriteFiles:on|off       overwrite the original nim files. DEFAULT is ON!
  --wholeProject                overwrite every processed file.
  --checkExtern:on|off          style check also extern names
  --styleCheck:on|off|auto      performs style checking for identifiers
                                and suggests an alternative spelling;
                                'auto' corrects the spelling.

In addition, all command line options of Nim are supported.