Skip to content

Latest commit

 

History

History
86 lines (66 loc) · 3.54 KB

CONTRIBUTING.md

File metadata and controls

86 lines (66 loc) · 3.54 KB

Devguide

2 space indentation, please.

Setup

  1. EditorConfig – If you haven't already, install the EditorConfig extension to prevent any conflicts between your default F# formatting conventions and the ones used by this project.

  2. You will need .NET Core v3.1 SDK installed. The versions of Mono and .NET Core currently tested in CI can be found here in .travis.yml

  3. Ensure .Net Core tools are on your PATH: $HOME/.dotnet/tools

  4. Set up of compiler state:

    source .env
    ./fake build
  5. New features:

    • Make your test for your change
    • Make your change
    • If appropriate, write docs in README.md.

Code style

  1. For variables: prefer test over t. Prefer test over sequencedTestCode.
  2. Try to stick to max 80 chars wide lines, unless it improves readability to let the line be longer. set tw=80 can be used in vim.
  3. If you have a function that takes a list of tests, let run then it's better to name the list/seq ts than l for three reasons:
    1. You may be using a sequence an not a list in the future, so l is not necessarily forwards-compatible.
    2. When iterating ts, it becomes natural to read and understand each element as t: Seq.mapi (fun i t -> ...)
    3. l is easily confused with I and 1, depending on typeface.

Futhermore, in no particular order;

  • Spaces after function names.
  • Spaces after parameter names like so param : typ.
  • 2 space indentation.
  • Use lowerCaseCamelCase, also on properties.
  • Interfaces do not start with I. Can you use a function instead, perhaps?
  • LF (not CRLF) in source files.
  • Prefer flat namespaces.
  • Prefer namespaces containing only what a consumer needs to use – no utilities should be public if it can be helped.
  • Follow the existing style of the library.
  • For single-argument function calls, prefer fn par over par |> fn. For multiple-argument function calls, par3 |> fn par1 par2 is OK.
  • No final newline in files, please.
  • Open specify open directives for the used namespaces and modules.
  • Prefer to cluster open directives at the top of the file.
  • Remember to follow the guidelines!

Invariants

  • I will release this project if all tests go through. If you contribute functionality you need to make sure that all tests pass and that the intended functionality is properly tested, otherwise it may break at any time.
  • Prefer to test all cases of your code, over testing only the happy path.

Logging/printing from within Expecto

  • If you want the logging/printing to properly print before the process exists, you need to use the logWithAck function, because the returned async will yield when the data has been written to the configured output.

Releasing

fake build -- --target Release