forked from ShadowTheAge/yafc
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: The Controbutors Guide started to feel bloated from the code suggestions. Solution: Put code suggestions into a separate page. While at it, add a thing that I think will make the project more readable -- blank lines around code blocks when reasonable. Also clean up some other `.md` files in a separate commit. The main change from the previous code style is the Blank Lines section. The rest is mostly the rewording of the info that we already had or applied.
- Loading branch information
Showing
5 changed files
with
65 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Yafc Code Style | ||
|
||
The Code Style describes the conventions that we use in the Yafc project. | ||
For the ease of collective development, we ask you to follow the Code Style when contributing to Yafc. | ||
|
||
### General guidelines | ||
|
||
The main idea is to keep the code maintainable and readable. | ||
|
||
* Aim for not-complicated code without dirty hacks. | ||
* Please document the code. | ||
* If you also can document the existing code, that is even better. The ease of understanding makes reading the code more enjoyable. | ||
|
||
### Commits | ||
* Please separate the change of behavior from the refactoring, into different commits. That helps to understand your commits easier. | ||
* Please make meaningful commit messages. We encourage you to use the prefixes from the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0-beta.2/#summary). They help to browse the commits later. | ||
|
||
### Code | ||
* In the programmers' haven, there is always a free spot for those who write tests. | ||
* Please try to keep the lines shorter than 120 characters. It simplifies the review of the changes on popular monitors. | ||
* If you add a TODO, then please describe the details in the commit message, or ideally in a github issue. That increases the chances of the TODOs being addressed. | ||
|
||
#### Difference with C# conventions | ||
Our conventions differ from the [Microsoft C# conventions](https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/identifier-names) | ||
due to legacy serialization and personal preferences. | ||
The most notable difference that is not controlled by [.editorconfig](/.editorconfig) is that class properties are named in camelCase. | ||
|
||
#### Blank lines | ||
Blank lines help to separate code into thematic chunks. | ||
We suggest to leave blank lines around code blocks like methods and keywords. | ||
For instance, | ||
``` | ||
public int funcName() { | ||
if() { // No blank line because there's nothing to separate from | ||
for (;;) { // No empty line because there's not much to separate from | ||
<more calls and assignments> | ||
} | ||
<more calls and assignments> // An empty line to clearly separate the code block from the rest of the code | ||
} | ||
<more calls and assignments> // An empty line to clearly separate the code block from the rest of the code | ||
} | ||
private void Foo() => Baz(); // An empty line between functions | ||
private void One(<a long description | ||
that goes on for | ||
several lines) { | ||
<more calls and assignments> // An empty line to clearly separate the definition and the start of the function | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# How to build YAFC from sources | ||
# How to build Yafc from sources | ||
|
||
- Download the sources | ||
- [Install dotnet core (v6.0 or later)](https://dotnet.microsoft.com/download) | ||
- Run Yafc/build.bat | ||
- Your built copy is located at Yafc/Build/Windows | ||
- Download the sources, | ||
- Install [dotnet core](https://dotnet.microsoft.com/download) (v8.0 or later), | ||
- Run `Yafc/build.sh`, | ||
- Your built copies are located at `Yafc/Build`. | ||
- If you want to run Yafc after that, please refer to the installation instructions in Readme. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters