Skip to content

Code Conventions

Rose edited this page Apr 13, 2022 · 19 revisions

Branching

  1. Use feature branches for all new features and bug fixes.
  2. Name feature branches for what the feature does feature/new-buttons
  3. Name bugfixes for the bug bugfix/page-blowing-up
  4. Merge feature branches into the development branch using pull requests.
  5. Keep a high quality, up-to-date development branch.

Pull Requests

  1. Keep on topic of the branch name and issue when submitting PRs
  2. Keep separate functionality in separate PRs and branches
  3. Be respectful of code reviewers time and sanity. It's an open source project, short on-topic succinct PRs are easier to review than long PRs with everything and the kitchen sink changed. Your code will go through review faster with smaller PRs.
  4. Link to an issue if possible. If there isn't one yet, create one in the Water the Trees Project board

Refactoring

  1. Complexity is a factor going against security and readability and maintainability, follow KISS.
  2. Refactorings should be small and should not break existing code.
  3. Always follow the camping rule. Leave the codebase healthier than when you found it. The change can be small.
  4. Refactoring should make the code easier to read.
  5. Refactoring should be part of a typical developer routine.
  6. If we need to refactor a large part of the system or a library, we make it a team effort. Whenever anyone goes near any code in the refactoring zone, we move it a little way in the direction we want to improve. Before you decide you want to refactor or rewrite everything while contributing a feature, please read this: Refactor-vs-Rewrite
  7. If there's not a clear need to rename files, functions, variables, leave naming conventions as-is. Name changes that help developers understand the code faster are preferable over generalization and obsuration.

Style Guide

  1. Use eslint and prettier. Please conform to our current styles in the linter, it makes it easier to read and less likely to have developer arguments.

Coding_conventions

Please look at the project list for code contributions we need or add a new idea and bring it up at the meeting! Water the Trees Project

THANK YOU for contributing to this project!

Clone this wiki locally