2020-02-28 00:24:27 +00:00
|
|
|
# Contributing to Aaru
|
2016-10-07 03:32:39 +01:00
|
|
|
|
2017-12-24 19:42:10 +00:00
|
|
|
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
|
|
|
|
|
|
2021-08-17 21:23:10 +01:00
|
|
|
The following is a set of guidelines for contributing to Aaru and its modules. These are mostly guidelines, not rules.
|
|
|
|
|
Use your best judgment, and feel free to propose changes to this document in a pull request.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
#### Table Of Contents
|
|
|
|
|
|
|
|
|
|
[Code of Conduct](#code-of-conduct)
|
|
|
|
|
|
|
|
|
|
[I don't want to read this whole thing, I just have a question!!!](#i-dont-want-to-read-this-whole-thing-i-just-have-a-question)
|
|
|
|
|
|
|
|
|
|
[What should I know before I get started?](#what-should-i-know-before-i-get-started)
|
2021-08-17 21:23:10 +01:00
|
|
|
|
|
|
|
|
* [Aaru and modules](#aaru-and-modules)
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
[How Can I Contribute?](#how-can-i-contribute)
|
2021-08-17 21:23:10 +01:00
|
|
|
|
|
|
|
|
* [Reporting Devices](#reporting-devices)
|
|
|
|
|
* [Reporting Bugs](#reporting-bugs)
|
|
|
|
|
* [Suggesting Enhancements](#suggesting-enhancements)
|
|
|
|
|
* [Your First Code Contribution](#your-first-code-contribution)
|
|
|
|
|
* [Pull Requests](#pull-requests)
|
|
|
|
|
* [Patronizing us](#patronizing)
|
|
|
|
|
* [Donating hardware to test](#donating)
|
|
|
|
|
* [Providing information](#needed-information)
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
[Styleguides](#styleguides)
|
2021-08-17 21:23:10 +01:00
|
|
|
|
|
|
|
|
* [Git Commit Messages](#git-commit-messages)
|
2021-08-19 13:46:53 +01:00
|
|
|
* [Code Styleguide](#code-style-guide)
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
## Code of Conduct
|
|
|
|
|
|
|
|
|
|
This project and everyone participating in it is governed by the
|
2021-08-17 21:23:10 +01:00
|
|
|
[Aaru Code of Conduct](.github/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please
|
|
|
|
|
report unacceptable behavior to [claunia@claunia.com](mailto:claunia@claunia.com).
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
## I don't want to read this whole thing I just have a question!!!
|
|
|
|
|
|
2021-08-17 21:23:10 +01:00
|
|
|
> **Note:** Please don't file an issue to ask a question. You'll get faster results by using the resources below.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
2021-05-20 01:40:19 +01:00
|
|
|
You can join our IRC channel on irc.libera.chat at channel #Aaru
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
## What should I know before I get started?
|
|
|
|
|
|
2020-02-28 00:24:27 +00:00
|
|
|
### Aaru and modules
|
2017-12-24 19:42:10 +00:00
|
|
|
|
2021-08-17 21:23:10 +01:00
|
|
|
Aaru is a large open source project — it's made up of 18 modules. When you initially consider contributing to
|
|
|
|
|
Aaru, you might be unsure about which of those modules implements the functionality you want to change or report a bug
|
|
|
|
|
for. This section should help you with that.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
2020-02-28 00:24:27 +00:00
|
|
|
Aaru is intentionally very modular. Here's a list of them:
|
2017-12-24 19:42:10 +00:00
|
|
|
|
2021-08-17 21:23:10 +01:00
|
|
|
* [Claunia.RsrcFork](https://github.com/claunia/Claunia.RsrcFork) - This library includes code for handling Mac OS
|
|
|
|
|
resource forks, and decoding them, so any code related to Mac OS resource forks should be added here.
|
|
|
|
|
* [Claunia.Encoding](https://github.com/claunia/Claunia.Encoding) - This library includes code for converting codepages
|
|
|
|
|
not supported by .NET, like those used by ancient operating systems, to/from UTF-8.
|
|
|
|
|
* [plist-cil](https://github.com/claunia/plist-cil) - This library includes code for handling Apple property lists.
|
|
|
|
|
* [SharpCompress](https://github.com/adamhathcock/sharpcompress) - This library includes code for handling compression
|
|
|
|
|
algorithms and compressed archives. Any need you have of compression or decompression should be handled with this
|
|
|
|
|
library, and any new algorithm should be added here.
|
|
|
|
|
* [Aaru](https://github.com/aaru-dps/Aaru/tree/master/Aaru) - This module contains the command line interface. In the
|
|
|
|
|
future a GUI will be added.
|
|
|
|
|
* [AaruRemote](https://github.com/aaru-dps/aaruremote) - Standalone small application designed to run on older machines
|
|
|
|
|
where Aaru does not run to allow device commands to be executed remotely.
|
|
|
|
|
* [Aaru.Checksums](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Checksums) - This module contains the checksum,
|
|
|
|
|
hashing and error correction algorithms.
|
|
|
|
|
* [Aaru.CommonTypes](https://github.com/aaru-dps/Aaru.CommonTypes) - This module contains interfaces, structures and
|
|
|
|
|
enumerations needed by more than one of the other modules.
|
|
|
|
|
* [Aaru.Console](https://github.com/aaru-dps/Aaru.Console) - This module abstracts consoles used by other modules to
|
|
|
|
|
output information, so they can be redirected to a CLI or to a GUI output.
|
|
|
|
|
* [Aaru.Core](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Core) - This module contains the implementation of the
|
|
|
|
|
functions and commands that are called by the user interface itself.
|
|
|
|
|
* [Aaru.Decoders](https://github.com/aaru-dps/Aaru.Decoders) - This module contains internal disk, drive and protocol
|
|
|
|
|
structures as well as code to marshal, decode and print them.
|
2022-03-07 07:36:44 +00:00
|
|
|
* [Aaru.Decryption](https://github.com/aaru-dps/Aaru.Decryption) - This module contains the media decryption code, like
|
|
|
|
|
CSS or CPRM.
|
2021-08-17 21:23:10 +01:00
|
|
|
* [Aaru.Devices](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Devices) - This module contains code to talk with
|
2021-08-19 13:46:53 +01:00
|
|
|
hardware devices in different platforms. Each platform has low-level calls in its own folder, and each device protocol
|
|
|
|
|
has high-level calls in its own folder. Device commands are separated by protocol standard, or vendor name.
|
2021-08-17 21:23:10 +01:00
|
|
|
* [Aaru.Device.Report](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Device.Report) - This is a separate application
|
2021-08-19 13:46:53 +01:00
|
|
|
in C89 designed to create device reports on environments where you can't run .NET or Mono but can run Linux.
|
2021-08-17 21:23:10 +01:00
|
|
|
* [Aaru.DiscImages](https://github.com/aaru-dps/Aaru/tree/master/Aaru.DiscImages) - This module provides reading
|
|
|
|
|
capabilities for the disk/disc images, one per file.
|
|
|
|
|
* [Aaru.DiscImages](https://github.com/aaru-dps/Aaru.Dto) - This module provides common structures between Aaru and
|
|
|
|
|
Aaru.Server.
|
|
|
|
|
* [Aaru.Filesystems](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Filesystems) - This module provides the
|
|
|
|
|
filesystem support. If only identification is implemented a single file should be used. For full read-only support, a
|
|
|
|
|
folder should be used.
|
|
|
|
|
* [Aaru.Filters](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Filters) - A filter is a modification of the data
|
|
|
|
|
before it can be passed to the disk image module
|
2021-08-19 13:46:53 +01:00
|
|
|
(compression, fork union, etc.), and this module provides support for them. If an image is compressed, say in gzip, or
|
|
|
|
|
encoded, say in AppleDouble, a filter is the responsible for decompressing or decoding it on-the-fly.
|
2021-08-17 21:23:10 +01:00
|
|
|
* [Aaru.Helpers](https://github.com/aaru-dps/Aaru.Helpers) - This module contains a collection of helpers for array
|
|
|
|
|
manipulation, big-endian marshalling, datetime conversion, hexadecimal printing, string manipulation and byte
|
|
|
|
|
swapping.
|
|
|
|
|
* [Aaru.Partitions](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Partitions) - This module contains code for
|
|
|
|
|
reading partition schemes.
|
|
|
|
|
* [Aaru.Server](https://github.com/aaru-dps/Aaru.Server) - This module contains the server-side code that's running
|
|
|
|
|
at https://www.aaru.app
|
|
|
|
|
* [Aaru.Settings](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Settings) - This module contains code for handling
|
|
|
|
|
Aaru settings.
|
|
|
|
|
* [Aaru.Tests](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Tests) - This module contains the unit tests for the
|
|
|
|
|
rest of the modules. You should add new unit tests here but cannot run all of them because the test images they
|
2021-08-19 13:46:53 +01:00
|
|
|
require amount to more than 900 GiB.
|
2022-03-07 07:36:44 +00:00
|
|
|
* [Aaru.Tests.Devices](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Tests.Devices) - This module presents a
|
|
|
|
|
menu-driven interface to send commands to devices, as a way to test the Core module, as those tests cannot be
|
|
|
|
|
automated. It can be used to debug drive responses.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
## How Can I Contribute?
|
|
|
|
|
|
|
|
|
|
### Reporting Devices
|
|
|
|
|
|
2021-08-19 13:46:53 +01:00
|
|
|
Aaru tries to be as universal as possible. However, some devices do not behave in the expected ways, some media is
|
2021-08-17 21:23:10 +01:00
|
|
|
unknown and needs to be known prior to enabling dumping of it, etc.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
2021-08-17 21:23:10 +01:00
|
|
|
For that reason, Aaru includes
|
|
|
|
|
the [device-report command](https://github.com/aaru-dps/Aaru/wiki/Reporting-physical-device-capabilities). Using this
|
2021-08-19 13:46:53 +01:00
|
|
|
command will guide you through a series of questions about the device, and if it contains removable media, for you to
|
2021-08-17 21:23:10 +01:00
|
|
|
insert the different media you have, and create a report of its abilities. The report will automatically be sent to our
|
|
|
|
|
server and saved on your computer. Please note that we do not store any personal information and when possible remove
|
|
|
|
|
the drive serial numbers from the report.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
2021-08-17 21:23:10 +01:00
|
|
|
If you have a drive attached to a computer that you cannot run the full Aaru on it but can compile a C89 application,
|
|
|
|
|
you can use [AaruRemote](https://github.com/aaru-dps/aaruremote)
|
2020-12-03 01:48:49 +00:00
|
|
|
and an ethernet connection between that machine and a machine that can run the full Aaru.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
### Reporting Bugs
|
|
|
|
|
|
2021-08-17 21:23:10 +01:00
|
|
|
This section guides you through submitting a bug report for Aaru. Following these guidelines helps maintainers and the
|
|
|
|
|
community understand your report :pencil:, reproduce the behavior :computer: :computer:, and find related reports :
|
|
|
|
|
mag_right:.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
2021-08-17 21:23:10 +01:00
|
|
|
Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you
|
|
|
|
|
don't need to create one. When you are creating a bug report, please
|
2022-03-07 07:36:44 +00:00
|
|
|
[include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out the required template, the
|
|
|
|
|
information it asks for helps us resolve issues faster.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new
|
|
|
|
|
> issue and include a link to the original issue in the body of your new one.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
#### Before Submitting A Bug Report
|
|
|
|
|
|
2021-08-19 13:46:53 +01:00
|
|
|
* **Check the [documentation](https://aaru.app)** for a list of common questions and problems.
|
2020-02-28 00:24:27 +00:00
|
|
|
* **Determine [which module the problem should be reported in](#aaru-and-modules)**.
|
2021-08-19 13:46:53 +01:00
|
|
|
* **Perform a [cursory search](https://github.com/search?q=+is%3Aissue)**
|
2021-08-17 21:23:10 +01:00
|
|
|
to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the
|
|
|
|
|
existing issue instead of opening a new one.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
#### How Do I Submit A (Good) Bug Report?
|
|
|
|
|
|
2021-08-17 21:23:10 +01:00
|
|
|
Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've
|
|
|
|
|
determined [which module](#aaru-and-modules) your bug is related to, create an issue on that repository and provide the
|
2021-08-19 13:46:53 +01:00
|
|
|
following information by filling in the template.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
Explain the problem and include additional details to help maintainers reproduce the problem:
|
|
|
|
|
|
|
|
|
|
* **Use a clear and descriptive title** for the issue to identify the problem.
|
2021-08-17 21:23:10 +01:00
|
|
|
* **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by
|
|
|
|
|
explaining how you started Aaru, e.g. which command exactly you used in the terminal. Also note that some device
|
|
|
|
|
commands requires you to have administrative privileges, be in a specific group, or be the root user, so try it again
|
|
|
|
|
with escalated privileges.
|
|
|
|
|
* **Provide specific examples to demonstrate the steps**. Include links to media images, reports of the devices, or the
|
|
|
|
|
output of using [Aaru.Tests.Devices](https://github.com/aaru-dps/Aaru/tree/master/Aaru.Tests.Devices).
|
|
|
|
|
* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that
|
|
|
|
|
behavior.
|
2017-12-24 19:42:10 +00:00
|
|
|
* **Explain which behavior you expected to see instead and why.**
|
|
|
|
|
* **Include a copy of the output in the terminal** enabling both verbose, using the `-v`
|
2021-08-17 21:23:10 +01:00
|
|
|
command line parameter, and debug, using the `-d` command line parameter, outputs.
|
|
|
|
|
* **If you're reporting that Aaru crashed**, try doing the same with the debug version and include a crash report with a
|
|
|
|
|
stack trace. Include the crash report in the issue in
|
|
|
|
|
a [code block](https://help.github.com/articles/markdown-basics/#multiple-lines), a
|
|
|
|
|
[file attachment](https://help.github.com/articles/file-attachments-on-issues-and-pull-requests/), or put it in
|
|
|
|
|
a [gist](https://gist.github.com/) and provide link to that gist.
|
|
|
|
|
* **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and
|
|
|
|
|
share more information using the guidelines below.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
Include details about your configuration and environment:
|
|
|
|
|
|
2020-02-28 00:24:27 +00:00
|
|
|
* **Which version of Aaru are you using?**
|
2017-12-24 19:42:10 +00:00
|
|
|
* **What's the name and version of the OS you're using**?
|
2021-08-17 21:23:10 +01:00
|
|
|
* **Are you running Aaru in a virtual machine?** If so, which VM software are you using and which operating systems and
|
|
|
|
|
versions are used for the host and the guest?
|
|
|
|
|
* **Are you trying to execute a device command?** If so, who manufactured the device, which model is it, and how is it
|
|
|
|
|
connected to the computer?
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
### Suggesting Enhancements
|
|
|
|
|
|
2021-08-17 21:23:10 +01:00
|
|
|
This section guides you through submitting an enhancement suggestion for Aaru, including completely new features and
|
|
|
|
|
minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand
|
|
|
|
|
your suggestion :pencil: and find related suggestions :mag_right:.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
2021-08-17 21:23:10 +01:00
|
|
|
Before creating enhancement suggestions,
|
2022-03-07 07:36:44 +00:00
|
|
|
please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion). Fill in the template,
|
|
|
|
|
including the steps that you imagine you would take if the feature you're requesting existed.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
#### How Do I Submit A (Good) Enhancement Suggestion?
|
|
|
|
|
|
2021-08-17 21:23:10 +01:00
|
|
|
Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). After you've
|
|
|
|
|
determined [which module](#aaru-and-modules) your enhancement suggestion is related to, create an issue on that
|
|
|
|
|
repository and provide the following information:
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
* **Use a clear and descriptive title** for the issue to identify the suggestion.
|
2021-08-17 21:23:10 +01:00
|
|
|
* **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
|
|
|
|
|
* **Provide specific examples to demonstrate the steps**. If the feature is about a media image, filesystem,
|
|
|
|
|
partitioning scheme, or filter, please include as many test files as possible, and if applicable which software
|
|
|
|
|
created them.
|
2017-12-24 19:42:10 +00:00
|
|
|
* **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
|
|
|
|
|
* **List some other applications where this enhancement exists.**
|
2020-02-28 00:24:27 +00:00
|
|
|
* **Specify which version of Aaru you're using.**
|
2017-12-24 19:42:10 +00:00
|
|
|
* **Specify the name and version of the OS you're using.**
|
|
|
|
|
|
|
|
|
|
### Your First Code Contribution
|
|
|
|
|
|
2020-02-28 00:24:27 +00:00
|
|
|
Unsure where to begin contributing to Aaru? You can start by looking through these `beginner` and `help-wanted` issues:
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
* [Beginner issues][beginner] - issues which should only require a few lines of code, and a test or two.
|
|
|
|
|
* [Help wanted issues][help-wanted] - issues which should be a bit more involved than `beginner` issues.
|
|
|
|
|
|
2021-08-17 21:23:10 +01:00
|
|
|
Both issue lists are sorted by total number of comments. While not perfect, number of comments is a reasonable proxy for
|
|
|
|
|
impact a given change will have.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
2020-12-03 01:48:49 +00:00
|
|
|
If you want to read about using Aaru, the [wiki](https://github.com/aaru-dps/Aaru/wiki) is available.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
2021-08-17 21:23:10 +01:00
|
|
|
Do not modify the interfaces. If you need or want to, comment in an issue how and why you want to change it and we'll
|
|
|
|
|
discuss it. Same applies for creating new interfaces.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
2021-08-19 13:46:53 +01:00
|
|
|
Aaru uses C# 8 language features (inline declaration, Tuples, etc.) so it can only be compiled
|
2022-03-07 07:36:44 +00:00
|
|
|
with [VisualStudio](http://www.visualstudio.com) 2019 or
|
|
|
|
|
higher, [Visual Studio for Mac](https://www.xamarin.com/download)
|
2021-08-19 13:46:53 +01:00
|
|
|
2019 or higher, or [JetBrains Rider](https://www.jetbrains.com/rider/) 2019.1 or higher.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
### Pull Requests
|
|
|
|
|
|
2018-10-13 16:16:59 -06:00
|
|
|
* Fill in [the required template](.github/PULL_REQUEST_TEMPLATE.md)
|
2017-12-24 19:42:10 +00:00
|
|
|
* Do not include issue numbers in the PR title
|
2021-08-19 13:46:53 +01:00
|
|
|
* Follow the [code styleguide](#code-style-guide).
|
2021-08-17 21:23:10 +01:00
|
|
|
* Include test files as applicable, that do not have software under copyright inside them, if possible.
|
2017-12-24 19:42:10 +00:00
|
|
|
* Document new code based using XML documentation wherever possible.
|
|
|
|
|
* DO NOT end files with a newline.
|
2021-08-17 21:23:10 +01:00
|
|
|
* Avoid platform-dependent code, unless absolutely needed. Any call to a part of the .NET framework that doesn't start
|
|
|
|
|
with `System.` is probably platform-dependent.
|
2017-12-24 19:42:10 +00:00
|
|
|
* Do not call libraries external to .NET. Only Interop calls to the operating system kernel
|
2021-08-17 21:23:10 +01:00
|
|
|
(that is `KERNEL32.DLL` in Windows and `libc` in others) will be accepted. If you need to talk with a USB devices your
|
|
|
|
|
pull request must implement calls both to `WinUsb` and `libusb`.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
### Patronizing
|
2021-08-17 21:23:10 +01:00
|
|
|
|
2020-12-03 01:48:49 +00:00
|
|
|
If you want to donate money you can become a patron at https://www.patreon.com/claunia
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
### Donating
|
2021-08-17 21:23:10 +01:00
|
|
|
|
2019-11-06 22:15:14 +00:00
|
|
|
You may donate us one of the [devices we need](NEEDED.md).
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
### Needed information
|
2021-08-17 21:23:10 +01:00
|
|
|
|
|
|
|
|
If you have test images, imaging applications that generate formats we do not support, or documentation about media dump
|
|
|
|
|
formats, filesystems or partitioning schemes we do not support, you can provide us with that information to add support
|
|
|
|
|
for them.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
## Styleguides
|
|
|
|
|
|
|
|
|
|
### Git Commit Messages
|
|
|
|
|
|
|
|
|
|
* Use the present tense ("Add feature" not "Added feature")
|
|
|
|
|
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
|
2021-08-19 13:46:53 +01:00
|
|
|
* Limit the first line to 72 characters or fewer
|
2017-12-24 19:42:10 +00:00
|
|
|
* Reference issues and pull requests liberally after the first line
|
2020-12-03 01:48:49 +00:00
|
|
|
|
|
|
|
|
### Code Style Guide
|
2017-12-24 19:42:10 +00:00
|
|
|
|
|
|
|
|
- Braces are unindented at next line (BSD style).
|
|
|
|
|
- Braces with no content should be opened and closed in the same line.
|
|
|
|
|
- Constants should be ALL_UPPER_CASE.
|
|
|
|
|
- Do not use braces for statements that don't need them.
|
|
|
|
|
- Do not use more than one blank line.
|
|
|
|
|
- Do not use spaces before or after parentheses.
|
|
|
|
|
- Do not use `var` ever.
|
|
|
|
|
- `else`, `while`, `catch` and `finally` should be on a new line.
|
|
|
|
|
- If you know C apply a simple rule: Be as C as and as less C# or C++ as possible.
|
2021-08-17 21:23:10 +01:00
|
|
|
- If you will only store variables, use a struct. If you need it to be nullable, use a nullable struct if applicable.
|
2017-12-24 19:42:10 +00:00
|
|
|
- Indent statements and cases.
|
|
|
|
|
- Indent using 4 spaces (soft tab).
|
2021-08-19 13:46:53 +01:00
|
|
|
- Instance and static fields should be lowerCamelCase.
|
2017-12-24 19:42:10 +00:00
|
|
|
- Public fields should be UpperCamelCase.
|
|
|
|
|
- Separate attributes.
|
|
|
|
|
- Use 120 columns margins.
|
|
|
|
|
- Use built-in keywords: `uint` instead of `UInt32`.
|
2021-08-17 21:23:10 +01:00
|
|
|
- Use expression bodies only for properties, indexes and events. For the rest use block bodies.
|
2017-12-24 19:42:10 +00:00
|
|
|
- Use implicit modifiers.
|
|
|
|
|
- Use inline variable declaration.
|
|
|
|
|
- Use struct implicit constructor.
|
2021-08-19 13:46:53 +01:00
|
|
|
- Use UNIX (`\n`) end line character.
|
2017-12-24 19:42:10 +00:00
|
|
|
|
2020-12-03 01:48:49 +00:00
|
|
|
> Note: There is an included editorconfig file that sets the appropriate code style.
|
|
|
|
|
|
2020-02-28 00:24:27 +00:00
|
|
|
> Note: Aaru is quite low-level so unneeded object-oriented abstractions
|
2017-12-24 19:42:10 +00:00
|
|
|
(e.g. using classes when a struct suffices) will be rejected. LINQ is accepted.
|