Skip to content

Contributing

Patrick Fong edited this page Jun 2, 2023 · 19 revisions

Copied and adapted from Tide's Contributing guide.

Code Conventions

Style Guide

  • if > and or or
  • test > [...]
  • Long forms of flags > short forms
    • Use short form for frequently used commands such as set
    • Note that MacOS utils often do not support long flags, in which case one should use the short option for cross-platform compatibility
  • Piping > command substitution
  • variable names should be snake cased

Variables

  • global variables that the user should not interact with should be prepended with _
  • keep variables functionally scoped

Format

Fish code formatting is done via fish_indent, which is available as a VSCode plugin. Markdown and YAML formatting is done via Prettier, run with just the defaults.

Naming Conventions

All variables and functions should be named in snake_case. For variables and functions exposed to the user but not meant for the user to interact with, prepend an underscore in front of the name.

Testing

Dependencies

Run tests like so from the repository root

CI=true fishtape tests/**.fish

CI=true prevents config/fzf.fish and fzf_configure_bindings from being skipped.

Feature development

Before opening up a PR to add a new feature, please run the idea by me and the community through a Discussion. That way, we can make sure the feature has the right characteristics and you don't risk investing time into a feature that ultimately doesn't fit.

When developing new features or changing existing features, make sure to update the readme and add tests.

General OSS development resources

These are resources I read that I'd like to aspire to and hope can be helpful for others as well. They are not necessarily relevant to fzf.fish.

Clone this wiki locally