Merge branch 'main' of git.deuxfleurs.fr:Deuxfleurs/diplonat into feature/modular-config
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Quentin 2021-09-20 11:58:03 +02:00
commit f9fd13a48a
Signed by: quentin
GPG Key ID: A98E9B769E4FF428
6 changed files with 64 additions and 7 deletions

24
.drone.yml Normal file
View 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
View 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.

View File

@ -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.

View File

@ -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() {

View File

@ -97,3 +97,4 @@ pub fn cleanup(ipt: &iptables::IPTables) -> Result<()> {
Ok(())
}

View File

@ -93,3 +93,4 @@ impl FirewallActor {
return Ok(());
}
}