Ein rewrite von merlin/fs-protocol in Rust
Go to file
Bennet Bleßmann a2b4b33868 release 0.7.0 2022-05-12 02:55:43 +02:00
.cargo change how the tests are run 2022-02-16 22:36:37 +01:00
dist/arch release 0.7.0 2022-05-12 02:55:43 +02:00
fs_protocol_bin release 0.7.0 2022-05-12 02:55:43 +02:00
fs_protocol_lib release 0.7.0 2022-05-12 02:55:43 +02:00
.gitattributes fix line ending problem 2020-02-19 01:39:09 +01:00
.gitignore split into lib and bin & add benchmarks 2020-09-19 23:35:54 +02:00
.mailmap add .mailmap 2022-03-26 00:56:43 +01:00
APACHE-2.0.LICENSE add MIT and Apache-2.0 License without annoying boilerplate 2022-03-08 22:52:41 +01:00
Cargo.lock release 0.7.0 2022-05-12 02:55:43 +02:00
Cargo.toml split into lib and bin & add benchmarks 2020-09-19 23:35:54 +02:00
Changelog.md release 0.7.0 2022-05-12 02:55:43 +02:00
MIT.LICENSE add MIT and Apache-2.0 License without annoying boilerplate 2022-03-08 22:52:41 +01:00
README.md release 0.7.0 2022-05-12 02:55:43 +02:00
deny.toml add cargo deny config and update readme 2022-02-15 00:00:14 +01:00
deps-with-dups.txt add .mailmap 2022-03-26 00:56:43 +01:00
deps.txt add .mailmap 2022-03-26 00:56:43 +01:00
open_docs.sh add more tests 2020-09-01 22:10:17 +02:00

README.md

FS-Protokoll

A rewrite of merlin/fs-protocol

This tool takes an input file via stdin and outputs its result via stdout.

Usage

To convert a plaintext protocol export to an xml proceeding you can either run

fs-protokoll[.exe] < input.txt > output.txt
or
cargo run < input.txt > output.txt
or
Drag-and-Drop the files to be converted onto the executable

The -g flag to generate reference test files can also be used to convert all protocols in the relative folder tests/data/in to files in tests/data/out.

The converter will try to parse the date, should it be successful then the parsed date will be inserted, otherwise YYYY-MM-DD will be inserted instead.

Build

Requirements:

  • Rust build tool cargo

Build steps:

  • cargo build or cargo build --release

Locating the Binary:
After building as described above the binary can be found in either target/debug or target/release.
It should be named fs-protokoll.exe on windows and fs-protokoll on linux.

Test

To test run cargo test

To generate new reference files run TRYCMD=dump cargo test -- <test> where <test> is one of markdown, etherpad or other_cmd this will generate .stdout and .stderr files in a dump/ directory.

To overwrite existing reference files run TRYCMD=overwrite cargo test -- <test> this will replace the existing reference files with newly generated ones.

For the tests that test -h and --help it is recommended to replace the version number (e.g. 0.6.0) with [..] to prevent it from having to update that test every version bump. [..] matches the regex [^\n]*? see the trycmd documentation for reference of this and other content elision patterns.

When adding new protocols as reference make sure to censor the content of [intern] tags.

To search for all lines containing the tag you can use the regex: \[intern\].*[^Xx\W] .
To find all lowercase letters and subsequently replace the with x the regex (?<=\[intern\].*)[a-wyzäöüß] can be used.

Benchmark (requires nightly toolchain)

To run benchmarks cargo +nightly bench

Currently, there are two benchmarks. The markdown benchmark takes approximately 365000 ns per iteration. The text benchmark takes approximately 354000 ns per iteration.

Check the minimal required rust version with cargo msrv

Install cargo-msrv e.g. cargo install cargo-msrv or pacman -S cargo-msrv

Run cargo msrv to determine minimal (required/supported) rust version

As of last check: 1.54.0

Test that the minimal version specified in Cargo.toml actually works

To run minimal test run: cargo +nightly update -Zminimal-versions and then cargo +nightly test -Zminimal-versions

This will run set cargo to resolve dependencies to the minimal version that is compatible with what is defined in the Cargo.toml, apposed to the default which is the maximum version. This is to prevent depending on features of higher versions by accident which can cause problems when other requirements may cause a version to be incompatible later on and then force resolution to an earlier version.

Check cargo deny

Checks

  • whether dependencies use an allowed license
  • whether dependencies come from an allowed source
  • duplicate dependencies and banned dependencies
  • advisories such as RustSec

Installation: -via cargo cargo install cargo-deny

Check cargo audit

Checks project against the advisories published by the RustSec project

Installation:

  • via cargo cargo install cargo-audit
  • via pacman (arch linux): packman -S cargo-audit Run Check: cargo audit