kiliankoe / swift-outdated

A swift subcommand for displaying when your dependencies (SwiftPM or Xcode) are out of date
MIT License
342 stars 14 forks source link

Support Markdown style table rendering #18

Closed daichikuwa0618 closed 2 years ago

daichikuwa0618 commented 2 years ago

Why?

What I did

Screenshots

help command

.build/debug/swift-outdated -h
OVERVIEW: Check for outdated dependencies.

swift-outdated will output an overview of your outdated dependencies found in your Package.resolved file.
Dependencies pinned to specific revisions or branches are ignored (and shown as such).

The latest version for dependencies one major version behind is colored green, yellow for two major versions
and red for anything above that.

swift-outdated automatically detects if it is run via an Xcode run script phase and will emit warnings for
Xcode's issue navigator.

USAGE: swift outdated [--markdown]

OPTIONS:
  -m, --markdown          Render table in Markdown style.
  --version               Show the version.
  -h, --help              Show help information.

w/o option (nothing changes)

.build/debug/swift-outdated
 ----------------------- --------- --------
  Package                 Current   Latest
 ----------------------- --------- --------
  Files                   4.1.1     4.2.0
  Rainbow                 3.1.5     4.0.1
  Version                 2.0.0     2.0.1
  swift-argument-parser   1.0.2     1.1.4
 ----------------------- --------- --------

w/ -m option (short style)

.build/debug/swift-outdated -m
| Package               | Current | Latest |
|-----------------------|---------|--------|
| Files                 | 4.1.1   | 4.2.0  |
| Rainbow               | 3.1.5   | 4.0.1  |
| Version               | 2.0.0   | 2.0.1  |
| swift-argument-parser | 1.0.2   | 1.1.4  |

w/ --markdown option (long style)

.build/debug/swift-outdated --markdown
| Package               | Current | Latest |
|-----------------------|---------|--------|
| Files                 | 4.1.1   | 4.2.0  |
| Rainbow               | 3.1.5   | 4.0.1  |
| Version               | 2.0.0   | 2.0.1  |
| swift-argument-parser | 1.0.2   | 1.1.4  |
daichikuwa0618 commented 2 years ago

@kiliankoe @ccxla Hi! I added Markdown style table option!

Could you review this?

kiliankoe commented 2 years ago

Hey @daichikuwa0618, this is great! Thanks for the change.

I don't see much worth in keeping both styles around, if you don't see anything that speaks against it, I'd be totally fine with making the markdown compatible table the default and dropping the option. What do you think?

daichikuwa0618 commented 2 years ago

I'd be totally fine with making the markdown compatible table the default and dropping the option. What do you think?

You have a point. I'll fix in this PR.

daichikuwa0618 commented 2 years ago

@kiliankoe cc @ccxla Thank you for your comment!

I changed Markdown as default style, and drop the option.

kiliankoe commented 2 years ago

I've also just bumped the version here and in the homebrew formulae, so you can just run brew upgrade swift-outdated to get the new version with this change 😊