Modular Diplonat (with the option to disable useless modules) #8
6 changed files with 64 additions and 7 deletions
24
.drone.yml
Normal file
24
.drone.yml
Normal file
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
kind: pipeline
|
||||
name: default
|
||||
|
||||
workspace:
|
||||
base: /drone/diplonat
|
||||
|
||||
steps:
|
||||
- name: code style
|
||||
image: rust:1.47
|
||||
commands:
|
||||
- rustup component add rustfmt
|
||||
- cargo fmt --all -- --check
|
||||
# - name: code quality
|
||||
# image: rust:1.47
|
||||
# commands:
|
||||
# - cargo clippy -- --deny warnings
|
||||
# - name: test
|
||||
# image: rust:1.47
|
||||
# commands:
|
||||
# - cargo build --verbose --all
|
||||
# - cargo test --verbose --all
|
||||
|
||||
|
34
CONTRIBUTING.md
Normal file
34
CONTRIBUTING.md
Normal file
|
@ -0,0 +1,34 @@
|
|||
# Contributing to Diplonat
|
||||
|
||||
## Development guidelines
|
||||
|
||||
### Code formatting
|
||||
|
||||
[Our CI pipeline](./.drone.yml) features a verification of the code format, using [rustfmt](https://github.com/rust-lang/rustfmt).
|
||||
|
||||
#### Installing rustfmt
|
||||
|
||||
You can run `rustfmt` with Rust 1.24 and above.
|
||||
|
||||
To install:
|
||||
|
||||
```
|
||||
rustup component add rustfmt
|
||||
```
|
||||
|
||||
#### Usage
|
||||
|
||||
To run on Diplonat, launch the following in the root directory:
|
||||
|
||||
```
|
||||
cargo fmt --all
|
||||
```
|
||||
|
||||
This will format the whole repository using the settigs defined in [`.rustfmt.toml`](./.rustfmt.toml): soft tabs of 2 spaces.
|
||||
|
||||
#### Auto-format code
|
||||
|
||||
You can automate formatting in a number of ways:
|
||||
|
||||
* [Setup your IDE to use `rustfmt`](https://github.com/rust-lang/rustfmt#running-rustfmt-from-your-editor).
|
||||
* Setup a git hook to run `rustfmt` before each commit.
|
|
@ -51,6 +51,10 @@ export RUST_LOG=debug
|
|||
cargo run
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Refer to [CONTRIBUTING.md](./CONTRIBUTING.md).
|
||||
|
||||
## Design Guidelines
|
||||
|
||||
Diplonat is made of a set of Components.
|
||||
|
|
|
@ -44,13 +44,6 @@ fn all_valid_options() -> HashMap<String, String> {
|
|||
opts
|
||||
}
|
||||
|
||||
// #[test]
|
||||
// #[should_panic]
|
||||
// fn err_empty_env() {
|
||||
// std::env::remove_var("DIPLONAT_CONSUL_NODE_NAME");
|
||||
// ConfigOpts::from_env().unwrap();
|
||||
// }
|
||||
|
||||
#[test]
|
||||
#[should_panic]
|
||||
fn err_empty_env() {
|
||||
|
|
|
@ -97,3 +97,4 @@ pub fn cleanup(ipt: &iptables::IPTables) -> Result<()> {
|
|||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
@ -93,3 +93,4 @@ impl FirewallActor {
|
|||
return Ok(());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue