~matthiasbeyer/imag

ref: 6bc08b60e6e3a99cc9a263713db33061d63dc964 imag/lib/entry/libimagentryview/src/builtin/md.rs -rw-r--r-- 2.1 KiB
Merge branch 'update-deps' into master

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
mdcat: 0.15 -> 0.17, syntect: 3 -> 4

And update the implementation for the new mdcat interface.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Merge branch 'update-mdcat' into master

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Update mdcat 0.13.0 -> 0.15.0

Make version restriction for syntect less strict, as mdcat pins it to a
certain version, and we only need it to actually invoke mdcat itself.
So no problem with that lax requirement.

Because mdcat updated its version of pulldown-cmark, we have to update
here as well.

We also had to adapt our error handling, because mdcat chooses to return
a Box<dyn Error>, which is absolutely garbage for us here.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Merge branch 'replace-failure-with-anyhow'

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Replace failure with anyhow in complete codebase

This patch was scripted with

    sed -i 's/use failure::Error/use anyhow::Error/' $(rg "use failure::Error" -l)
    sed -i 's/use failure::Fallible as /use anyhow::/' $(rg "use failure::Fallible" -l)
    sed -i 's/failure/anyhow/' $(rg "failure *=" -l)
    sed -i 's/format_err!/anyhow!/' $(rg "format_err!" -l)
    sed -i 's/use failure::ResultExt/use anyhow::Context/' $(rg "use failure::ResultExt" -l)
    sed -i 's/err_msg/anyhow!/' $(rg "use failure::err_msg" -l)
    sed -i 's/^anyhow\ *=.*$/anyhow = "1"/' $(rg "anyhow * =" -l)
    sed -i 's/^anyhow_derive.*//' $(rg "anyhow_derive" -l)
    sed -i 's/extern crate failure/extern crate anyhow/' $(rg "extern crate failure" -l)
    sed -i 's/.*extern crate anyhow_derive.*//' $(rg "anyhow_derive" -l)

Some manual changes were added as well, so this patch was not completely
scripted, but mostly.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Update copyright years to 2015-2020

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Pull changes from https://github.com/flip1995/imag clippy_fix

This pulls in the clippy fixes from Phil. From the request-pull:

-----8<-----
    I finally got to fixing all of the Clippy warnings in the imag codebase.
    `cargo test` passes, `cargo clippy` doesn't produce any warnings
    or errors.

    Some important notes:
      - I didn't pay attention to the line length of the changes, so it may
        have happened that some lines are now longer than 100 chars
      - Except two commits the commit messages are formatted as follows:
        * The first tag shows if the changes in the commit were
          automatically applied by `cargo fix --clippy -Zunstable-options`.
          Commits that were automatically applied may require closer review,
          since I didn't check those by hand and the Clippy fix feature is
          still unstable.
        * The other tags specify the subcrate that is affected by the
          commit. I created one commit for each subcrate, even when only one
          file (most of the time the `main.rs` file) was changed.
      - I created one commit, where I replace usages of `r#try!` with the
        `?` operator, since `try!` is now officially deprecated.
      - I created one commit, where I just allow Clippy lints. Either because
        the fix would require much more work or knowledge of the codebase or
        because it was a FP.

    This was pretty much work, but it helped detecting a few bugs in Clippy,
    where I was already able to open 3 or 4 PRs. So win-win I guess.

    [...] we got a net LoC decrease.
----->8-----
a8bb180a — flip1995 2 years ago
[No-auto] lib/entry/view: Fix Clippy warnings

Signed-off-by: flip1995 <hello@philkrones.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Fix for update to new version of mdcat

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Merge branch 'libimagentryview-propagate-io-errors' into master
Change interface of Viewer to propagate io errors

Because we need to catch errors that are caused by a borken pipe when
writing to stdout (for example), this patch changes the interface of the
Viewer trait to return an error enum that can be used to check whether
an IO error happened.

The calling code can then decide whether to ignore a broken pipe error
or whether to handle it properly.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Run 'cargo fix' for rust-2018

With this patch we move the codebase to Rust-2018.

The diff was generated by executing

    cargo fix --all --all-features --edition

on the codebase.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Update copyright years

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Merge branch 'minor'

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Update dependency: mdcat: 0.8 -> 0.11
Merge branch 'failure'

I'm so happy to finally be able to merge this patchset. After four days
of work, we finally convert the whole codebase from error_chain error
handling to failure.

Dependencies are now imported from "master" or even "failure" branches,
which will result in dependencies breaking the imag build as soon as the
"failure" branches vanish or the master breaks on the dependencies, but
we do it anyways until we are in release-shape.

Thanks goes to Kai for emotional support during the last weekend while
developing this patchset.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
libimagentryview: Move from error-chain to failure

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Merge pull request #1442 from matthiasbeyer/imag-view/markdown-compile

imag-view: markdown compile
Add markdown viewer functionality