Skip to content

Commit

Permalink
chore: finishing touches on repository (#111)
Browse files Browse the repository at this point in the history
Co-authored-by: Raphael Strotz <Xzelsius@users.noreply.github.com>
  • Loading branch information
Xzelsius and Xzelsius authored Oct 24, 2024
1 parent 025db77 commit daf1b44
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 63 deletions.
52 changes: 9 additions & 43 deletions .github/CODE_GUIDELINES.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,13 @@
# Code Guidelines

The general rule we follow is **use Visual Studio defaults**.
Ayaka uses an `.editorconfig` file that covers most of the coding style.

1. We use Allman style braces, where each brace begins on a new line. A single line statement block
can go without braces but the block must be properly indented on its own line and it must not be
nested in other statement blocks that use braces (See rule 15 for more details). One exception
is that a using statement is permitted to be nested within another using statement by starting
on the following line at the same indentation level, even if the nested using contains a
controlled block.
2. We use four spaces of indentation (no tabs).
3. We use `_camelCase` for internal and private fields and use `readonly` where possible. Prefix
internal and private instance fields with `_`. When used on static fields, `readonly` should come
after static (e.g. `static readonly` not `readonly static`). Public fields should be used sparingly,
but when they are used, they should use `PascalCasing`, no prefix.
4. We avoid `this.` unless absolutely necessary.
5. We always specify the visibility, even if it's the default (e.g. `private string _foo` not
`string _foo`). Visibility should be the first modifier (e.g. `public abstract` not
`abstract public`).
6. Namespace imports should be specified at the top of the file, _outside_ of `namespace`
declarations and should be sorted alphabetically, with the exception of `System.*` namespaces,
which are to be placed on top of all others.
7. Avoid more than one empty line at any time. For example, do not have two blank lines between
members of a type.
8. Avoid spurious free spaces. For example avoid `if (someVar == 0)...`, where the dots mark the
spurious free spaces.
9. We only use `var` when it's obvious what the variable type is (e.g. `var stream = new FileStream(...)`
not `var stream = OpenStandardInput()`).
10. We use language keywords instead of BCL types (e.g. `int`, `string`, `float` instead of
`Int32`, `String`, `Single`, etc) for both type references as well as method calls (e.g. `int.Parse`
instead of `Int32.Parse`)
11. We use `PascalCasing` to name all our constant local variables and fields. The only exception
is for interop code where the constant value should exactly match the name and value of the
code you are calling via interop.
12. We use `nameof(...)` instead of `"..."` whenever possible and relevant.
13. Fields should be specified at the top within type declarations.
14. When including non-ASCII characters in the source code use Unicode escape sequences (`\uXXXX`)
instead of literal characters. Literal non-ASCII characters occasionally get garbled by a tool or
editor.
15. When using a single-statement if, we follow these conventions:
* Never use single-line form (for example: `if (source == null) throw new ArgumentNullException("source");`)
* Using braces is always accepted, and required if any block of an `if/else` / `if/.../else` compound
statement uses braces or if a single statement body spans multiple lines.
* Braces may be omitted only if the body of every block associated with an `if/else` / `if/.../else`
compound statement is placed on a single line.
This file is automatically used by Visual Studio and other editors to ensure that the code is formatted correctly.

_Our `.edtorconfig` should help your editor to match these code style and formatting rules._
::: info
The `.editorconfig` isn't flawless, but should give you a good starting point to what I expect.
:::

For a more detailed overview regarding the code guidelines, please refer to the [Documentation].

[Documentation]: https://xzelsius.github.io/Ayaka/contributing/code-guidelines
19 changes: 6 additions & 13 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Looking to contribute something to Ayaka? Here are some basic rules we would lik
- [Found a Bug?](#bug-reports)
- [Missing a Feature?](#feature-requests)
- [Submission Guidelines](#pull-requests)
- [Coding Guidlines](#code-guidelines)
- [Coding Guidelines](#code-guidelines)

Besides that, check the [Documentation] for more information.

## Code of Conduct

Expand All @@ -19,11 +21,8 @@ A bug is a demonstrable problem that is caused by the code in the repository. Go
Guidelines for bug reports:

1. Check if the issue has already been reported — [Issues]

2. Check if the issue has been fixed — Try to reproduce it using the latest `main` branch

3. Isolate the problem

4. Submit using the `Bug report` template — [Submit a Bug report]

A good bug report shouldn't leave other needing to chase you up for more information. Please try to be as detailed as possible in your report.
Expand All @@ -32,10 +31,9 @@ A good bug report shouldn't leave other needing to chase you up for more informa

Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature.

Guidlines for feature requests:
Guidelines for feature requests:

1. Check if the feature has already been requested — [Issues]

2. Submit using the `Feature request` template — [Submit a feature request]

Please provide as much detail and context as possible.
Expand All @@ -44,20 +42,14 @@ Please provide as much detail and context as possible.

Good pull requests are a fantastic help. They should remain focused in scope and avoid containing unrelated commits.

Guidlines for pull requests:
Guidelines for pull requests:

1. Fork the project and clone your fork

2. If you cloned a while ago, get the latest changes from upstream

3. Create a new topic branch to contain your feature, change, or fix

4. Commit your changes in logical chunks

5. Locally rebase the upstream `main` branch into your topic branch

6. Push your topic branch up to your fork

7. Open a Pull request against the `main` branch — [Open a Pull Request]

See [About pull requests] for more information.
Expand All @@ -66,6 +58,7 @@ See [About pull requests] for more information.

Please read and follow our [Coding Guidelines].

[Documentation]: https://xzelsius.github.io/Ayaka/contributing/sources
[Code of Conduct]: https://github.com/Xzelsius/Ayaka/blob/main/.github/CODE_OF_CONDUCT.md
[Issues]: https://github.com/Xzelsius/Ayaka/issues
[Submit a bug report]: https://github.com/Xzelsius/Ayaka/issues/new?template=bug_report.yml
Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@ Ayaka is a collection of packages, aiming to help developing applications using

## Compatibility

We aim to support the latest non-preview version of .NET.
See [.NET and .NET Core Support Policy] for more information.
Ayaka aims to support the latest non-preview version of .NET.
Check the [Compatibility Documentation] for more information.

There are no plans for any multi-target builds, as we don't want the additional complexity of such.
There are no plans for any multi-target builds, as I don't want the additional complexity of such.

## Getting started
## Documentation

Soon... :)
I hope my [documentation] should help you get started with Ayaka.
If you still have any questions, feel free to ask in the [Discussions].

## Contributing

Interested in contributing to Ayaka?
Read our [contributing guide] to learn about our development process and how to propose bug fixes and improvements.
Read our [contributing guide] to learn about Ayaka's development process and how to propose bug fixes and improvements.

[.NET and .NET Core Support Policy]: https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core
[contributing guide]: https://github.com/Xzelsius/Ayaka/blob/main/.github/CONTRIBUTING.md
[Compatibility Documentation]: https://xzelsius.github.io/Ayaka/guide/compatibility
[documentation]: https://xzelsius.github.io/Ayaka
[Discussions]: https://github.com/Xzelsius/Ayaka/discussions

0 comments on commit daf1b44

Please sign in to comment.