added custom strings + LICENSE.md and CONTRIBUTING.md
parent
96c8a69681
commit
54e9df9e82
@ -0,0 +1,28 @@
|
||||
# Crystal Linux Contributing Guidelines
|
||||
|
||||
#### !! Always make sure to `git pull` before doing any work to avoid commit hell !!
|
||||
|
||||
### Pre-Commit Checks
|
||||
|
||||
- Make sure to `cargo fmt` your code before every commit push
|
||||
- Unless in specific edge cases, don't push code that doesn't pass `cargo check`
|
||||
- Try to correct any code with `cargo clippy` before you push
|
||||
|
||||
### Formatting
|
||||
|
||||
- UNIX line endings (LF instead of CRLF)
|
||||
- 4 spaces per TAB
|
||||
|
||||
### Good Practices
|
||||
|
||||
- Try to use .unwrap() as little as possible
|
||||
- Try to never use panic!() in production code, always try to have a possible way to resolve errors, even if it's just
|
||||
unwrap_or/_else()
|
||||
- Never use println!() or eprintln!() in finalised code. Using string functions (e.g. info() in Amethyst v3.0.0) is
|
||||
preferred
|
||||
- Compartmentalise as much as you can, avoid writing the exact same line of code 50 times if you can turn it into a
|
||||
function
|
||||
|
||||
### Examples of these guidelines in practice
|
||||
|
||||
- https://git.getcryst.al/crystal/ame/src/branch/rewrite
|
@ -0,0 +1,23 @@
|
||||
The Nolicense Revision 2.1 - Monday 15th November 2021
|
||||
|
||||
Copyright (c) 2022 Crystal Linux Team
|
||||
|
||||
Everyone is permitted to freely copy and distribute this license document. Modified redistributions are subject to the
|
||||
following license agreement.
|
||||
|
||||
The Nolicense terms and conditions for copying, distribution and modification of software and any created assets are as
|
||||
follows:
|
||||
|
||||
- Any unmodified redistributions in either source code or binary form must retain this copyright notice in its entirety.
|
||||
|
||||
- Any and all redistributions or derivative works, whether modified or unmodified, must credit the original author(s) of
|
||||
the source code, and provide an easily accessible way to find the original author's source code, wherever it may be
|
||||
published.
|
||||
|
||||
- Derivative works and modified redistributions cannot be published under the same name as the original software, nor
|
||||
can it be presented as an extension of or newer revision of said software, and unless explicitly permitted, the
|
||||
original authors name(s) shall not be used to endorse said derivative works.
|
||||
|
||||
This software is provided as-is; Neither the copyright holders nor any contributors to the software are to be held
|
||||
liable for any damages caused by any files attached. By modifying or redistributing the software in any way, you
|
||||
automatically agree to the terms of the license agreement.
|
@ -1,2 +1,10 @@
|
||||
pub mod strings;
|
||||
mod strings;
|
||||
pub mod structs;
|
||||
|
||||
pub fn info(a: String) {
|
||||
strings::info(a);
|
||||
}
|
||||
|
||||
pub fn crash(a: String, b: i32) {
|
||||
strings::crash(a, b);
|
||||
}
|
@ -1 +1,10 @@
|
||||
use std::process::exit;
|
||||
|
||||
pub fn info(a: String) {
|
||||
println!("\x1b[2;22;30mμ\x1b[0m \x1b[1;37m{}\x1b[0m", a);
|
||||
}
|
||||
|
||||
pub fn crash(a: String, b: i32) {
|
||||
println!("\x1b[2;22;31m❌:\x1b[0m \x1b[1;91m{}\x1b[0m", a);
|
||||
exit(b);
|
||||
}
|
Loading…
Reference in New Issue