Skip to content

Commit

Permalink
Version 0.1.4
Browse files Browse the repository at this point in the history
Add pre-commit git hook file
Fix lint errors.

Signed-off-by: Nathaniel Clark <[email protected]>
  • Loading branch information
utopiabound committed Jun 13, 2023
1 parent 46ea959 commit 2b6a801
Showing 6 changed files with 62 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rpn-rs"
version = "0.1.3"
version = "0.1.4"
authors = ["Nathaniel Clark <[email protected]>"]
edition = "2021"
keywords = [ "fltk", "rpn", "calculator", "tui" ]
32 changes: 25 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -2,19 +2,37 @@

RPN-rs is an RPN calculator written in rust using FLTK.

Also can be run as CLI or as a TUI.

## Features

* Number - Scaler (via [rug](latest/rug/struct.Integer.html) crate)
* Arbitrary precision rational numbers ([GMP](https://gmplib.org/))
* High-precision floating-point ([MPFR](https://www.mpfr.org/))
* Complex numbers ([MPC](https://www.multiprecision.org/mpc/))
* Numbers - Matrix (via [libmat](https://github.com/wiebecommajonas/libmat))
* Matricies of any of above Scalers
* Correct interaction between Scalers and Matricies
* UI
* GUI - Graphical User Interface
* TUI - Full terminal user interface
* CLI - Basic interacive CLI

## Goals
* RPN Calculator handling the following:
* Arbitrary precision rational arithmetic
* Large precision floating point arithmetic
* Complex arithmetic
* Matrixes of the above
* Simple stack view

* RPN Calculator
* Arbitrary precision
* Matrixes
* Simple stack view

## Linux (Fedora) Build Requires

* libstdc++-static
* libpng-devel
* libjpeg-devel
* zlib-devel

## Inspired by
* [GRPN](https://github.com/utopiabound/grpn)

* [GRPN](https://github.com/utopiabound/grpn)
* HP RPN Calculators (e.g. HP48G+)
33 changes: 33 additions & 0 deletions scripts/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
#
# rustfmt edition should match what is present in Cargo.toml
# weblint is provided by the HTML::Lint perl package

HAS_ISSUES=false

for file in $(git diff --name-only --staged); do
FMT_RESULT=""
if [ ! -e $file ]; then
continue
fi
case "$file" in
*.rs) FMT_RESULT="$(rustfmt --edition 2021 --check $file 2>/dev/null || true)" ;;
*.html) [ -n "$(which weblint)" ] && FMT_RESULT="$(weblint $file)" ;;
*.md) [ -n "$(which mdl)" ] && FMT_RESULT="$(mdl $file)" ;;
esac

if [ -n "$FMT_RESULT" ]; then
if $HAS_ISSUES; then
echo -n ", "
fi
echo -n "$file"
HAS_ISSUES=true
fi
done

if $HAS_ISSUES; then
echo -e "\nYour code has formatting issues in files listed above. Format your code!"
exit 1
fi

exit 0
2 changes: 1 addition & 1 deletion src/fixtures/help.html
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ <h1>RPN-rs is a graphical reverse polish notation (RPN) calculator</h1>
<tr><th colspan=4>Stack Operations</th></tr>
<tr><td>clear</td><td><i>all</i></td><td colspan=2>clear stack and history</td></tr>
<tr><td>drop | pop | del</td><td>1</td><td colspan=2>Remove first item on stack</td></tr>
<tr><td>dup | <i>[enter]</i><td>0</td><td colspan=2>Duplicate first item on stack</td></tr>
<tr><td>dup | <i>[enter]</i></td><td>0</td><td colspan=2>Duplicate first item on stack</td></tr>
<tr><td>rollu(p) | ru(p) | roll</td><td>0</td><td colspan=2>Pop 1 item, and move it to end of stack</td></tr>
<tr><td>rolld(own) | rd(own)</td><td>0</td><td colspan=2>Opposite of rollup</td></tr>
<tr><td>swap | sw</td><td>0</td><td colspan=2>Swap first two items on stack</td></tr>
2 changes: 1 addition & 1 deletion src/ui/fltk.rs
Original file line number Diff line number Diff line change
@@ -224,7 +224,7 @@ impl CalcDisplay for FltkCalcDisplay {
self.table.redraw();
}
FltkMessage::About => self.dialog(format!(
"RPN Calculator {} (c) 2022",
"RPN Calculator {} (c) 2023",
env!("CARGO_PKG_VERSION")
)),
FltkMessage::Copy => {

0 comments on commit 2b6a801

Please sign in to comment.