Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a basic Markdown output formatter - and some basic docs #35

Merged
merged 9 commits into from
Apr 16, 2018

Conversation

asgrim
Copy link
Member

@asgrim asgrim commented Apr 15, 2018

Fixes #20

@asgrim asgrim added this to the 0.0.1 milestone Apr 15, 2018
@asgrim asgrim requested review from akrabat and Ocramius April 15, 2018 16:18

TBD - still in development
* Your project uses `git`
* You use semver formatted `git` tags like `1.2.3` to mark releases
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we support parsing things like release-1.2.3 or v1.2.3?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now at least, no. Issue maybe?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#37

README.md Outdated
You must currently install the tool using:

```bash
$ composer require roave/api-compare
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

composer require --dev


This will automatically detect the last minor version tagged, and
compare the API against the current `HEAD`. If any BC breaks are found,
the tool returns a non-zero status, which on most CI systems will cause
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably document that it is 2

README.md Outdated
documentation for changelogs:

```bash
$ vendor/bin/api-compare --markdown=bc-breaks.md
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's please just use STDOUT. No file writing, please @_@

Running the tool with options:

```bash
$ vendor/bin/api-compare [--from=] [--to=] [--markdown=] [<sources-path>]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just call it --format=markdown instead?

attempt to figure out the last minor version released.
* `--to=<revision>` specify manually what the "new" version (e.g.
`1.1.0` or a specific `git` hash). The default value is `HEAD`.
* `--markdown=<filename>` If provided, the tool will generate the list
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again: file output should probably be avoided. Better to send everything to STDOUT

* `<sources-path>` if given, you can specify in which directory to
examine for classes. This defaults to `src`.

## Configuration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop zis

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bcoz empty

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are currently no configuration options available.


$markdownFile = trim((string)$input->getOption('markdown'));
if ($markdownFile !== '') {
$output->write(sprintf('Generating markdown in %s...', $markdownFile));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should write to STDOUT and STDERR separately: https://gist.github.com/MattKetmo/3665488

$this->outputFilename = $outputFilename;
}

public function write(Changes $changes) : void
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

: string

{
$arrayOfChanges = $changes->getIterator()->getArrayCopy();

file_put_contents(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of above: to be avoided. Let's rely on standard piping and output redirection techniques instead.

@asgrim asgrim force-pushed the feature/markdown-formatter branch from cfe33f6 to 4a2a585 Compare April 15, 2018 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants