renderorange / git-lint Goto Github PK
View Code? Open in Web Editor NEWPluggable framework for linting git commits and messages.
Home Page: https://metacpan.org/dist/Git-Lint
License: MIT License
Pluggable framework for linting git commits and messages.
Home Page: https://metacpan.org/dist/Git-Lint
License: MIT License
On systems with older perl (< 5.22) and non-English locale the test suite fails:
# Failed test 'exception matches expected'
# at t/unit/lib-Git-Lint-Check-Message/message.t line 48.
# 'open: filename: Datei oder Verzeichnis nicht gefunden at /home/cpansand/.cpan/build/2022022602/Git-Lint-0.008-zktBqU/t/unit/lib-Git-Lint-Check-Message/../../../lib/Git/Lint/Check/Message.pm line 25.
# '
# doesn't match '(?^:open: filename: No such file or directory)'
# Looks like you failed 1 test of 7.
t/unit/lib-Git-Lint-Check-Message/message.t .....
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/7 subtests
Note that it is possible to set $!
and inspect the expected error message:
$ perl5.20.3 -MErrno=ENOENT -E '$!=ENOENT; say "$!"'
Datei oder Verzeichnis nicht gefunden
$ env LC_ALL=C perl5.20.3 -MErrno=ENOENT -E '$!=ENOENT; say "$!"'
No such file or directory
The SYNOPSIS
examples for message check modules isn't correct.
my $input = $plugin->message();
The message
method requires the file
argument.
my $input = $plugin->message( file => $filepath );
tests should:
unless ( $ENV{TEST_RELEASE} ) {
my $msg = 'Release test. Set $ENV{TEST_RELEASE} to a true value to run.';
plan( skip_all => $msg );
}
The GoFmt.pm module was originally added as an example for adding different kinds of checks to run through hooks.
Since it relies on an external program, gofmt, it should exist as a dist on it's own, not within the core check modules; which are meant to be agnostic to programming languages themselves.
The report methods aren’t indicative of what they’re doing. They should be named something like format.
The parse methods run report before returning the issues. Both methods should be independent so the check modules can decide to call report or not.
Add a local directory outside of the perl5 lib path for users to add modules to.
As is, a user would need to contribute their modules to the project, or install them into perl5 lib themselves. There should be an easier way for them to do it.
t/unit/lib-Git-Lint/new.t
fails on windows builds on cpantesters because git isn't in PATH.
git-lint: 'git' is not recognized as an internal or external command,
operable program or batch file.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 1 just after 2.
t/unit/lib-Git-Lint/new.t .......................
Dubious, test returned 1 (wstat 256, 0x100)
http://www.cpantesters.org/cpan/report/35342dc9-719a-1014-abe9-cb992d67b6a1
The unit test itself shouldn't rely on the external program anyway, regardless of build environment. It's coincidence that the linux and bsd builds have it there for it to pass.
The INSTALLATION section for Git::Lint's documentation is defined twice.
Either rename the second INSTALLATION to something else, or move the contents into the first one.
Version 0.018 released two commit check modules that will run in conflict with each other. If a user is relying on the default configuration, this creates a situation where upgrading to a new version or fresh install won’t allow the user to add a commit before adding a configuration file.
To keep this from happening, it would make more sense to assume no checks by default and print a warning indicating no checks have been configured to run. This minimally means upgrades won’t break the ability to commit, and fresh installs won’t put a user in a broken state.
Upgrade the version to 1.0.0 with that change.
the config load method only builds the profiles data structure if modules are found.
my @commit_checks = List::MoreUtils::apply {s/$namespace\:\://g} $loader->find_modules( $namespace, { max_depth => 1 } );
if (@commit_checks) {
$self->{profiles}{commit}{default} = \@commit_checks;
}
$namespace = 'Git::Lint::Check::Message';
my @message_checks = List::MoreUtils::apply {s/$namespace\:\://g} $loader->find_modules( $namespace, { max_depth => 1 } );
if (@message_checks) {
$self->{profiles}{message}{default} = \@message_checks;
}
if no modules are found, the load method returns an empty hashref, rather than a fully formed structure with an empty default key.
update the config load method to build the fully formed profiles structure first, then add modules into the default key if found.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.