cva6/CONTRIBUTING.md
Florian Zaruba 9ea677b843 Fix issue #8
2017-05-05 11:06:37 +02:00

2.5 KiB

Styleguides

Coding Style

  • Keep the files tidy. No superfluous line breaks, align ports on a common boundary.
  • All signal and module names should be lower case with underscores as whitespace replacements (e.g.: fetch_busy).
  • Instantiation of modules should be postfix with _i, e.g.: prefetcher_i
  • For port definitions keep a post-fix direction (_o, _i).
  • For active low signals put an additional (_no, _ni).
  • Denote output of ff with _q and the input with _n.
  • Name dedicated signals wiring module A (output) with module B (input) signal_a_b
  • Do not use CamelCase
  • Do not put overly large comment headers. Nevertheless, try to structure your HDL code, e.g.:
  // ------------------------------------
  // CSR - Control and Status Registers
  // ------------------------------------

Git Considerations

  • Do not push to master, if you want to add a feature do it in your branch
  • Separate subject from body with a blank line
  • Limit the subject line to 50 characters
  • Capitalize the subject line
  • Do not end the subject line with a period
  • Use the imperative mood in the subject line
  • Use the present tense ("Add feature" not "Added feature")
  • Wrap the body at 72 characters
  • Use the body to explain what and why vs. how
  • Consider starting the commit message with an applicable emoji:
    • 🎨 :art: when improving the format/structure of the code
    • 🐎 :racehorse: when improving performance
    • 📝 :memo: when writing docs
    • 🐧 :penguin: when fixing something on Linux
    • 🍎 :apple: when fixing something on macOS
    • 🏁 :checkered_flag: when fixing something on Windows
    • 🐛 :bug: when fixing a bug
    • 🔥 :fire: when removing code or files
    • 💚 :green_heart: when fixing the CI build
    • :white_check_mark: when adding tests
    • 🔒 :lock: when dealing with security
    • ⬆️ :arrow_up: when upgrading dependencies
    • ⬇️ :arrow_down: when downgrading dependencies
    • 👕 :shirt: when removing linter warnings
    • ✂️ :scissors: when restructuring your HDL
    • 👾 :space_invader: when fixing something synthesis related

For a detailed why and how please refer to one of the multiple resources regarding git commit messages.

If you use vi for your commit message, consider to put the following snippet inside your ~/.vimrc:

autocmd Filetype gitcommit setlocal spell textwidth=72s