#+startup: showall
#+options: toc:nil

# Copyright 2024 The MathWorks, Inc.

* Contributing

#+begin_quote
/If you believe you have discovered a security vulnerability, please *do not* open an issue or make
a pull request.  Follow the instructions in the [[file:SECURITY.md][SECURITY.md]] file in this repository./
#+end_quote

Thank you for your interest in contributing to a MathWorks repository!  We encourage contributions
large and small to this repository.

*Contributions do not have to be code!* If you see a way to explain things more clearly or a great
example of how to use something, please contribute it (or a link to your content).  We welcome
issues even if you don't code the solution.  We also welcome pull requests to resolve issues that we
haven't gotten to yet!

* How to contribute

- *Open an issue:* Start by ([[https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-an-issue][creating an issue]]) in the repository that you're interested in.  That
  will start a conversation with the maintainer.  When you are creating a bug report, please
  include as many details as possible.  Please remember that other people do not have your
  background or understanding of the issue; make sure you are clear and complete in your
  description.

- *Work in your own public fork:* If you choose to make a contribution, you should [[https://docs.github.com/en/get-started/quickstart/fork-a-repo][fork the repository]].
  This creates an editable copy on GitHub where you can write, test, and refine your
  changes.  We suggest that you keep your changes small and focused on the issue you submitted.

- *Sign a Contributor License Agreement (CLA):* We require that all outside contributors sign a [[https://en.wikipedia.org/wiki/Contributor_License_Agreement][CLA]]
  before we can accept your contribution.  When you create a pull request (see below), we'll reach
  out to you if you do not already have one on file.  Essentially, the CLA gives us permission to
  publish your contribution as part of the repository.

- *Make a pull request:* "[[https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests][Pull Request]]" is a confusing term, but it means exactly what it says:
  You're requesting that the maintainers of the repository pull your changes in.  If you don't have
  a CLA on file, we'll reach out to you.  Your contribution will be reviewed, and we may ask you to
  revise your pull request based on our feedback.  Once everyone is satisfied, we'll merge your
  pull request into the repository.

* Guidelines

1. Emacs LISP code

   + Should be indented using the default Emacs indentation.
   + Use Unix (LF) line endings in *.el files
   + Pass emacs-lisp syntax checker in flycheck.
   + Have no warnings (=make= should produce no warnings)
   + Add tests when possible
   + Pass =make tests=

2. MATLAB code

   We don't have best practices for writing MATLAB®; code, but we do have some recommendations:

   - You should not have any warnings or errors in the [[http://www.mathworks.com/help/matlab/matlab_prog/matlab-code-analyzer-report.html][code analyzer report]].
   - [[https://blogs.mathworks.com/loren][Loren Sure's blog]] has [[https://blogs.mathworks.com/loren/category/best-practice/][great advice on improving your MATLAB code.]]
   - Examples should be written as [[https://www.mathworks.com/help/matlab/matlab_prog/what-is-a-live-script-or-function.html][live scripts]] and then [[https://www.mathworks.com/help/matlab/matlab_prog/share-live-scripts.html][exported as HTML]].
   - We adhere to the [[https://commonmark.org/][CommonMark]] specification where it does not conflict with GitHub rendering.

*Again, thanks for contributing, and we look forward to your issues and pull requests!*

# LocalWords:  showall md LF flycheck Sure's
