Giter VIP home page Giter VIP logo

git-lint's People

Contributors

renderorange avatar

Watchers

 avatar  avatar

git-lint's Issues

t/unit/lib-Git-Lint-Check-Message/message.t may fail with non-English locale

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

Fix documentation for message check modules

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 );

Add release tests

tests should:

  • start with a block to only run if release variable is set:
unless ( $ENV{TEST_RELEASE} ) {
    my $msg = 'Release test. Set $ENV{TEST_RELEASE} to a true value to run.';
    plan( skip_all => $msg );
}
  • verify the Changelog contains the last commits since last release
  • verify the Changelog syntax and structure, including the correct date format
  • verify the MANIFEST is current
  • verify all files are correctly incremented for that release version number

Move the GoFmt.pm check module into its own dist

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.

Rename report methods

The report methods aren’t indicative of what they’re doing. They should be named something like format.

Break report methods out from parse

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 local directory for users to add pluggable check modules

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.

Override Git::Lint::Config user_config in t/unit/lib-Git-Lint/new.t

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.

Make configuration setup required

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.

Update config load to build profiles regardless of found modules

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.