| 1 | <!DOCTYPE html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <title>kew (/kjuː/, a variant of cue) is a terminal music player.</title> |
| 5 | <meta charset="utf-8" /> |
| 6 | <meta http-equiv="Expires" content="-1" /> |
| 7 | <meta http-equiv="Pragma" content="no-cache" /> |
| 8 | <meta http-equiv="Cache-Control" content="no-cache" /> |
| 9 | <link href="css/style.css" type="text/css" rel="stylesheet" /> |
| 10 | </head> |
| 11 | |
| 12 | <body id="landing"> |
| 13 | |
| 14 | <p class="kew-logo-wrapper"><a style="kew-logo" href="/"><img src="images/kew.gif" alt="kew terminal music player screenshot" /></a></p> |
| 15 | |
| 16 | <header> |
| 17 | <p>kew (/kjuː/, a variant of cue) is a terminal music player.</p> |
| 18 | </header> |
| 19 | |
| 20 | <div class="navbar"> |
| 21 | <a href="/">Home</a> |
| 22 | <a href="donate.html">Donate</a> |
| 23 | <a href="download.html">Download</a> |
| 24 | <a href="docs.html">Docs</a> |
| 25 | <a href="contribute.html">Contribute</a> |
| 26 | <a href="testimonials.html">Testimonials</a> |
| 27 | <a href="credits.html">Credits</a> |
| 28 | <a href="merch.html">Merch</a> |
| 29 | <a href="sponsors.html">Sponsors</a> |
| 30 | </div> |
| 31 | |
| 32 | <article data-sblg-article="1" data-sblg-set-title="kew (/kjuː/, a variant of cue) is a terminal music player." data-sblg-set-subtitle="kew (/kjuː/) is a variant of cue" data-sblg-set-tagline="Music for the Shell"> |
| 33 | <h2>Welcome to the contributing guide</h2> |
| 34 | <p>Thank you for your interest in contributing to kew!</p> |
| 35 | <p>kew is developed on: |
| 36 | <a href="https://codeberg.org/ravachol/kew">https://codeberg.org/ravachol/kew</a> - Issues, PR:s go here.</p> |
| 37 | <p>Mirror: |
| 38 | <a href="https://github.com/ravachol/kew">https://github.com/ravachol/kew</a> - Still used for some workflows that haven’t been migrated yet.</p> |
| 39 | <h3>Goal of the project</h3> |
| 40 | <p>The goal of kew is to provide a quick and easy way for people to listen to music with the absolute minimum of inconvenience. |
| 41 | It’s a small app, limited in scope and it shouldn’t be everything to all people. It should continue to be a very light weight app.</p> |
| 42 | <p>For instance, it’s not imagined as a software for dj’ing or as a busy music file manager with all the features.</p> |
| 43 | <p>We want to keep the codebase easy to manage and free of bloat, so might reject a feature out of that reason only.</p> |
| 44 | <h3>Reporting Bugs and Suggesting Enhancements</h3> |
| 45 | <p>Please report any bugs on <a href="https://codeberg.org/ravachol/kew/issues">Codeberg</a>, with as much relevant detail as possible.</p> |
| 46 | <hr/> |
| 47 | <h2>Security</h2> |
| 48 | <h3>Reporting a Bug</h3> |
| 49 | <p>If you find a security related issue, please contact us at kew-player AT proton DOT me.</p> |
| 50 | <p>When a fix is published, you will receive credit under your real name or bug |
| 51 | tracker handle in Codeberg. If you prefer to remain anonymous or pseudonymous, |
| 52 | you should mention this in your e-mail.</p> |
| 53 | <h3>Disclosure Policy</h3> |
| 54 | <p>The maintainer will coordinate the fix and release process, involving the |
| 55 | following steps:</p> |
| 56 | <ul> |
| 57 | <li>Confirm the problem and determine the affected versions.</li> |
| 58 | <li>Audit code to find any potential similar problems.</li> |
| 59 | <li>Prepare fix for the latest release. This fix will be |
| 60 | released as fast as possible.</li> |
| 61 | </ul> |
| 62 | <p>You may be asked to provide further information in pursuit of a fix.</p> |
| 63 | <hr/> |
| 64 | <h2>For Developers</h2> |
| 65 | <p>This text will help you setup your development environment. It is intended to be beginner friendly as we welcome and encourage people who are just starting to learn about programming in C to contribute to this project. We also welcome senior developers of course, but much of this document will be redundant if you are experienced.</p> |
| 66 | <h3>Before doing a lot of work</h3> |
| 67 | <p>Please contact us first and discuss your plans if you are trying to do something big, so your PR doesn’t get rejected after having spent a lot of time on it. You can for instance open a PR that contains your intent, and continue working on it if the response is positive.</p> |
| 68 | <h3>Just ask</h3> |
| 69 | <p>If you run into any problems just ask for help in an email to kew-player AT proton DOT me or in the PR itself.</p> |
| 70 | <h3>Prerequisites</h3> |
| 71 | <p>Before contributing, ensure you have the following tools installed on your development machine:</p> |
| 72 | <ul> |
| 73 | <li><a href="https://gcc.gnu.org/">GCC</a> (or another compatible C/C++ compiler)</li> |
| 74 | <li><a href="https://www.gnu.org/software/make/">Make</a></li> |
| 75 | <li><a href="https://git-scm.com/">Git</a></li> |
| 76 | <li><a href="http://valgrind.org/">Valgrind</a></li> |
| 77 | <li>An editor: <a href="https://vscodium.com/">VSCodium</a>, <a href="https://code.visualstudio.com/">VSCode</a>, <a href="https://www.vim.org">Vim</a>, <a href="https://www.gnu.org/software/emacs/">Emacs</a> or some other editor.</li> |
| 78 | </ul> |
| 79 | <h3>Building the Project</h3> |
| 80 | <p>Run the following commands:</p> |
| 81 | <pre><code> git clone https://codeberg.org/ravachol/kew.git --single-branch --branch develop |
| 82 | cd kew |
| 83 | make DEBUG=1 -j |
| 84 | sudo make install |
| 85 | </code></pre> |
| 86 | <p>You can use either DEBUG=1 or DEBUG=2. DEBUG=2 is helpful because it crashes on any errors and logs why. Both log to error.log.</p> |
| 87 | <h3>Coding style</h3> |
| 88 | <p>We have adopted the same coding style for the most part as the Linux kernel developers: |
| 89 | <a href="https://www.kernel.org/doc/html/v4.10/process/coding-style.html">https://www.kernel.org/doc/html/v4.10/process/coding-style.html</a></p> |
| 90 | <p>If you can, use EditorConfig for VS Code Extension that is prepared for this style. There is a file with settings for it: .editorconfig.</p> |
| 91 | <h3>Commenting</h3> |
| 92 | <p>Please refrain from using a lot of comments, and make sure that they are in English. I am not a big believer in comments and avoid commenting as much as possible. If you feel you need to add a comment, please first consider if you can make the function or variable names clearer, or if you can structure the code differently so that it is simpler and the intent is clear, or if you can make the code block into a function with a name that explains crystally clear what is going on. Remove comments that aren’t strictly needed.</p> |
| 93 | <h3>Architecture</h3> |
| 94 | <p>Pic: <a href="images/kew_architecture.png">kew architecture diagram</a></p> |
| 95 | <p>kew developers should strive to follow the above architecture, so that function calls only go in the direction of the arrows. For instance, functions in ops module never call functions in ui module as there is no arrow pointing from ops to ui. Please make sure your PR follows this architecture, and place your code in the correct module (directory). If you have doubts in where to place it, just ask.</p> |
| 96 | <h3>Debugging with VSCodium</h3> |
| 97 | <ol> |
| 98 | <li><p>Install extension clangd, C/C++ Debug (gdb) and EditorConfig.</p></li> |
| 99 | <li><p>Install the program bear that can generate a compile_commands.json. This helps clangd find libs.</p></li> |
| 100 | <li><p>Run bear -- make.</p></li> |
| 101 | </ol> |
| 102 | <p>This should enable you to develop kew on VSCodium.</p> |
| 103 | <h3>Memory debugging with Valgrind</h3> |
| 104 | <p>To use Valgrind for memory debugging:</p> |
| 105 | <p>Run make.</p> |
| 106 | <p>Run Valgrind on your binary:</p> |
| 107 | <pre><code>valgrind --leak-check=full --track-origins=yes --show-leak-kinds=all \ |
| 108 | --log-file=valgrind-out.txt --show-reachable=no -s ./kew |
| 109 | </code></pre> |
| 110 | <h3>Create a pull request</h3> |
| 111 | <p>After making any changes, open a pull request on Codeberg, develop branch.</p> |
| 112 | <h3>Issue assignment</h3> |
| 113 | <p>We don’t have a process for assigning issues to contributors. Please feel free to jump into any issues in this repo that you are able to help with. Duplicate work might be avoided if everybody keeps an eye on what’s going on on in the repo.</p> |
| 114 | </article> |
| 115 | <footer> |
| 116 | <p>Like kew?</p> |
| 117 | <div class="support-button"> |
| 118 | <a href="donate.html">Support the project</a> |
| 119 | </div> |
| 120 | |
| 121 | <p>Music for the Shell</p> |
| 122 | |
| 123 | </footer> |
| 124 | |
| 125 | <script |
| 126 | data-goatcounter="https://kew.goatcounter.com/count" |
| 127 | async="async" |
| 128 | src="//gc.zgo.at/count.js"> |
| 129 | </script> |
| 130 | |
| 131 | </body> |
| 132 | |
| 133 | </html> |
| 134 |