Skip to content

Commit

Permalink
Prepare 0.6.1
Browse files Browse the repository at this point in the history
Add filename to parser exception message.
Add script which checks for that everything is in order for new tags.

closes #50
  • Loading branch information
mihaeu committed Jul 14, 2019
1 parent 2e19a89 commit 1db9b3a
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 5 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Expand Up @@ -5,9 +5,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [0.6.1] - 2019-07-14
### Added
- Added filename to parser exception message

### Fixed
- Fixed return type of edge case for abstractness metric
- Fixed BC break in symfony/console 4.3

## [0.6.0] - 2019-04-09
### Added
- support for Docker
Expand Down Expand Up @@ -70,7 +76,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- first tagged release
- uml, text, dsm and metrics command

[Unreleased]: https://github.com/mihaeu/dephpend/compare/0.6.0...HEAD
[Unreleased]: https://github.com/mihaeu/dephpend/compare/0.6.1...HEAD
[0.6.1]: https://github.com/mihaeu/dephpend/compare/0.6.0...0.6.1
[0.6.0]: https://github.com/mihaeu/dephpend/compare/0.5.1...0.6.0
[0.5.1]: https://github.com/mihaeu/dephpend/compare/0.5.0...0.5.1
[0.5.0]: https://github.com/mihaeu/dephpend/compare/0.4.0...0.5.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -127,7 +127,7 @@ $ php -n dephpend.phar
__| | ___| |__) | |__| | |__) |__ _ __ __| |
/ _` |/ _ \ ___/| __ | ___/ _ \ '_ \ / _` |
| (_| | __/ | | | | | | | __/ | | | (_| |
\__,_|\___|_| |_| |_|_| \___|_| |_|\__,_| version 0.6.0
\__,_|\___|_| |_| |_|_| \___|_| |_|\__,_| version 0.6.1
Usage:
command [options] [arguments]
Expand Down
2 changes: 1 addition & 1 deletion bin/dephpend
Expand Up @@ -32,7 +32,7 @@ $name = <<<EOT
EOT;

$dependencyContainer = new DependencyContainer($internals);
$application = new Application($name, '0.6.0', $dependencyContainer->dispatcher());
$application = new Application($name, '0.6.1', $dependencyContainer->dispatcher());
$application->add($dependencyContainer->umlCommand());
$application->add($dependencyContainer->dotCommand());
$application->add($dependencyContainer->dsmCommand());
Expand Down
46 changes: 46 additions & 0 deletions bin/prepare-tag
@@ -0,0 +1,46 @@
#!/usr/bin/env bash

set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace

declare -r __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# shellcheck source=$HOME/dotfiles/scripts/helpers
source "${HOME}/dotfiles/scripts/helpers"

function main() {
readonly TAG="${1:-}"
if [[ $TAG = "" || ! $TAG =~ ^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}$ ]]; then
_error "Please provide the git tag (e.g. 2.31.2) as the first argument."
exit 1
fi

if git show "${TAG}" >/dev/null 2>&1; then
_error "Tag already exists."
exit 2
fi

if [[ $(grep -cF "${TAG}" "${__dir}/../README.md") != 1 ]]; then
_error "${TAG} not found in README.md."
exit 3
fi

if [[ $(grep -cF "${TAG}" "${__dir}/../bin/dephpend") != 1 ]]; then
_error "${TAG} not found in binary."
exit 4
fi

if [[ $(grep -cF "${TAG}" "${__dir}/../CHANGELOG.md") != 3 ]]; then
_error "${TAG} not mentioned or linked in CHANGELOG.md."
exit 5
fi

git tag -a "${TAG}" -m "${TAG}"
readonly EXIT_CODE="$?"
[[ $EXIT_CODE = 0 ]] && _success "Git tag successfully created." || _error "Command 'git tag failed'."
exit "${EXIT_CODE}"
}

main "$@"
2 changes: 1 addition & 1 deletion src/Analyser/Metrics.php
Expand Up @@ -24,7 +24,7 @@ public function abstractness(DependencyMap $map) : float
+ $this->interfaceCount($map)
+ $this->traitCount($map);
if ($abstractions === 0) {
return 0;
return 0.0;
}
$allClasses = $abstractions + $this->classCount($map);
return $abstractions / $allClasses;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Cli/MetricsCommandTest.php
Expand Up @@ -46,7 +46,7 @@ public function testPrintsMetrics(): void
$this->metrics->method('abstractClassCount')->willReturn(2);
$this->metrics->method('interfaceCount')->willReturn(3);
$this->metrics->method('traitCount')->willReturn(4);
$this->metrics->method('abstractness')->willReturn(5);
$this->metrics->method('abstractness')->willReturn(5.0);
$this->metrics->method('afferentCoupling')->willReturn(['A' => 1]);
$this->metrics->method('efferentCoupling')->willReturn(['A' => 1]);
$this->metrics->method('instability')->willReturn(['A' => 1]);
Expand Down

0 comments on commit 1db9b3a

Please sign in to comment.