From 0d18eb524be1948a809d9e472797c95ca29813e9 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Tue, 24 Jul 2018 22:41:56 -0400 Subject: [PATCH] Remove fuzzing, add CONTRIBUTING/CONTRIBUTORS --- CONTRIBUTING.md | 44 +++++++++++++++++++++++++++++++++ CONTRIBUTORS.md | 6 +++++ fuzz/.gitignore | 5 ---- fuzz/Cargo.toml | 22 ----------------- fuzz/fuzzers/fuzzer_script_1.rs | 10 -------- 5 files changed, 50 insertions(+), 37 deletions(-) create mode 100644 CONTRIBUTING.md create mode 100644 CONTRIBUTORS.md delete mode 100644 fuzz/.gitignore delete mode 100644 fuzz/Cargo.toml delete mode 100644 fuzz/fuzzers/fuzzer_script_1.rs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..3570335 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,44 @@ +# Contributing + +The `dtparse` crate is better for the contributions made by members of the open source community, +and seeks to make it easy to contribute back to the community it comes from. The goals are +fairly straight-forward, but here are the ways that would be most beneficial: + +## Bug Reports + +The testing suite for `dtparse` is built using tests derived from the [`dateutil`](https://github.com/dateutil/dateutil) +package in Python. Some Rust-specific behavior may show up though, for example in how +Rust handles nanoseconds where Python's standard library will only go to microseconds. + +If you believe that behavior is improper, you are encouraged to file an issue; there are no dumb +issues or suggestions, and the world is a better place for having your input. + +## Testing/Fuzzing + +`dtparse`'s history as a port of Python software has led to some behavior being shown in Rust +that would not otherwise be an issue in Python. Testing for these issues to prevent panics +is greatly appreciated, and some great work has already happened surrounding fuzzing. + +New test cases built either by fuzzers or humans are welcome. + +## Feature Requests + +Handling weird date formats and quirks is the name of the game. Any ideas on how to improve that +or utilities useful in handling the mapping of human time to computers is appreciated. + +Writing code to implement the feature is never mandatory (though always appreciated); if there's +something you believe `dtparse` should do that it doesn't currently support, let's make that happen. + +# Development Setup + +The setup requirements for `dtparse` should be fairly straightforward - the project can be built +and deployed using only the `cargo` tool in Rust. + +Much of the test coee is generated from Python code, and then the generated versions are stored +in version control. Thi is to ensure that all users can run the tests even without +installing Python or the other necessary packages. + +To regenerate the tests, please use Python 3.6 with the `dateutil` package installed, and run: + +- `python build_pycompat.py` +- `python build_pycompat_tokenizer.py` diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md new file mode 100644 index 0000000..344b4fe --- /dev/null +++ b/CONTRIBUTORS.md @@ -0,0 +1,6 @@ +This project benefits from the Rust and open source communities, but most specifically from these people: + +# Contributors: + +- [@messense](https://github.com/messense) +- [@mjmeehan](https://github.com/mjmeehan) \ No newline at end of file diff --git a/fuzz/.gitignore b/fuzz/.gitignore deleted file mode 100644 index dfeb7db..0000000 --- a/fuzz/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ - -target -libfuzzer -corpus -artifacts diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml deleted file mode 100644 index 0350800..0000000 --- a/fuzz/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ - -[package] -name = "dtparse-fuzz" -version = "0.0.1" -authors = ["Automatically generated"] -publish = false - -[package.metadata] -cargo-fuzz = true - -[dependencies.dtparse] -path = ".." -[dependencies.libfuzzer-sys] -git = "https://github.com/rust-fuzz/libfuzzer-sys.git" - -# Prevent this from interfering with workspaces -[workspace] -members = ["."] - -[[bin]] -name = "fuzzer_script_1" -path = "fuzzers/fuzzer_script_1.rs" diff --git a/fuzz/fuzzers/fuzzer_script_1.rs b/fuzz/fuzzers/fuzzer_script_1.rs deleted file mode 100644 index 92cd04c..0000000 --- a/fuzz/fuzzers/fuzzer_script_1.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![no_main] -extern crate libfuzzer_sys; -extern crate dtparse; -use dtparse::parse; -#[export_name="rust_fuzzer_test_input"] -pub extern fn go(data: &[u8]) { - if let Ok(s) = std::str::from_utf8(data) { - parse(s); - } -}