Update styling guide [skip ci]

next
Sayan Nandan 2 years ago
parent 54d2075a6d
commit b3bc07fd49
No known key found for this signature in database
GPG Key ID: 8BC07A0A4D41DD52

@ -3,8 +3,6 @@
Firstly, thank you for your interest in contributing to this project! This project is powered by the community
and relies on hackers across the globe to report bugs, send suggestions and contribute code to move this project forward.
You can see a list of contributors **[here](./CONTRIBUTORS.md)**
## Ways to contribute
- **#1**: Report bugs
@ -29,6 +27,21 @@ In other cases, use the C style.
### Formatting
- All Rust code should be formatted using `rustfmt`
- Imports in Rust source files are to be merged into a single `use` block. For example, instead of:
```rust
use devtimer::SimpleTimer;
use devtimer::ComplexTimer;
use serde::{Serialize, Deserialize};
use crate::something;
```
this mode of styling is preferred:
```rust
use {
devtimer::{SimpleTimer, ComplexTimer},
serde::{Serialize, Deserialize},
crate::something,
};
```
### Parts of the project
@ -73,7 +86,7 @@ commit messages to avoid triggering the workflows.
3. Sign the CLA (if you haven't signed it already)
4. One of the maintainers will review your patch and suggest changes if required
5. Once your patch is approved, it will be merged into the respective branch
6. Done, you're now one of the [contributors](./CONTRIBUTORS.md)!
6. Done, you're now a contributor 🎉!
## Development environment setup
@ -103,4 +116,4 @@ Testing is simple: just run this:
make test
```
> **NOTE**: Make sure port 2003 and 2004 are not used by any applications. Also, make sure your _own instance_ isn't running on any of these ports; if that is the case, you might end up losing data due to conflicting entity names! The test suite creates a `testsuite` keyspace and some tables within it to run all the tests.
> **NOTE**: Make sure ports 2003 and 2004 are not used by any applications. Also, make sure your _own instance_ isn't running on any of these ports; if that is the case, you might end up losing data due to conflicting entity names! The test suite creates a `testsuite` keyspace and some tables within it to run all the tests.

@ -1,4 +0,0 @@
# Contributors
These amazing people have contributed to TerrabaseDB: (Sorted by number of contributions)
1. Sayan Nandan <<ohsayan@outlook.com>>

@ -24,9 +24,8 @@
*
*/
use crate::cli::Cli;
use {
crate::{runner::Runner, tokenizer},
crate::{cli::Cli, runner::Runner, tokenizer},
clap::Parser,
crossterm::{
cursor, execute,

@ -1,5 +1,4 @@
use clap::Parser;
use clap::ArgAction;
use clap::{ArgAction, Parser};
const HELP_TEMPLATE: &'static str = r#"
{before-help}{name} {version}
@ -12,18 +11,35 @@ const HELP_TEMPLATE: &'static str = r#"
#[derive(Parser)]
#[command(author, version, about, long_about=None, disable_help_flag=true, help_template=HELP_TEMPLATE)]
pub struct Cli {
#[arg(short = 'C', long = "sslcert", help="Sets the PEM certificate to use for SSL connections", value_name = "CERT")]
#[arg(
short = 'C',
long = "sslcert",
help = "Sets the PEM certificate to use for SSL connections",
value_name = "CERT"
)]
pub ssl_cert: Option<String>,
#[arg(short = 'e', long = "eval", help = "Run one or more expressions without REPL", value_name = "EXPRESSION", num_args=0..)]
pub expressions: Option<Vec<String>>,
#[arg(short, long, help = "Sets the remote host to connect to", default_value = "127.0.0.1", value_name = "HOST")]
#[arg(
short,
long,
help = "Sets the remote host to connect to",
default_value = "127.0.0.1",
value_name = "HOST"
)]
pub host: String,
#[arg(short, long, help = "Sets the remote port to connect to", default_value_t = 2003, value_name = "PORT")]
#[arg(
short,
long,
help = "Sets the remote port to connect to",
default_value_t = 2003,
value_name = "PORT"
)]
pub port: u16,
#[arg(long, help="Print help information", action=ArgAction::Help)]
pub help: Option<bool>
pub help: Option<bool>,
}

Loading…
Cancel
Save