Bennet Bleßmann a2b4b33868 | ||
---|---|---|
.cargo | ||
dist/arch | ||
fs_protocol_bin | ||
fs_protocol_lib | ||
.gitattributes | ||
.gitignore | ||
.mailmap | ||
APACHE-2.0.LICENSE | ||
Cargo.lock | ||
Cargo.toml | ||
Changelog.md | ||
MIT.LICENSE | ||
README.md | ||
deny.toml | ||
deps-with-dups.txt | ||
deps.txt | ||
open_docs.sh |
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
orcargo 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
- via aur https://aur.archlinux.org/packages/cargo-deny
Run Check:
cargo deny check
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