# This Makefile.PL for Perl-Critic-PJCJ was generated by
# Dist::Zilla::Plugin::MakeMaker::Awesome 0.49.
# Don't edit it but the dist.ini and plugins used to construct it.

use strict;
use warnings;

use ExtUtils::MakeMaker;

my %WriteMakefileArgs = (
  "ABSTRACT" => "Perl::Critic policies for code style consistency",
  "AUTHOR" => "Paul Johnson <paul\@pjcj.net>",
  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0
  },
  "DISTNAME" => "Perl-Critic-PJCJ",
  "EXE_FILES" => [
    "script/perl-quote-fix"
  ],
  "LICENSE" => "perl",
  "NAME" => "Perl::Critic::PJCJ",
  "PREREQ_PM" => {
    "Cwd" => 0,
    "Encode" => 0,
    "File::Basename" => 0,
    "File::Temp" => 0,
    "Getopt::Long" => 0,
    "List::Util" => "1.33",
    "PPI" => "1.220",
    "Perl::Critic" => 0,
    "Pod::Usage" => 0,
    "Scalar::Util" => 0,
    "parent" => 0
  },
  "TEST_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0,
    "File::Spec" => 0,
    "IO::Handle" => 0,
    "IPC::Open3" => 0,
    "Test2::V0" => 0,
    "Test::More" => 0
  },
  "VERSION" => "v0.3.0",
  "test" => {
    "TESTS" => "t/*.t t/CodeLayout/ProhibitLongLines/*.t t/Fixer/*.t t/Utils/SourceLocation/*.t t/ValuesAndExpressions/RequireConsistentQuoting/*.t"
  }
);

my %FallbackPrereqs = (
  "Cwd" => 0,
  "Encode" => 0,
  "ExtUtils::MakeMaker" => 0,
  "File::Basename" => 0,
  "File::Spec" => 0,
  "File::Temp" => 0,
  "Getopt::Long" => 0,
  "IO::Handle" => 0,
  "IPC::Open3" => 0,
  "List::Util" => "1.33",
  "PPI" => "1.220",
  "Perl::Critic" => 0,
  "Pod::Usage" => 0,
  "Scalar::Util" => 0,
  "Test2::V0" => 0,
  "Test::More" => 0,
  "parent" => 0
);

unless ( eval { ExtUtils::MakeMaker->VERSION('6.63_03') } ) {
  delete $WriteMakefileArgs{TEST_REQUIRES};
  delete $WriteMakefileArgs{BUILD_REQUIRES};
  $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}

delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
  unless eval { ExtUtils::MakeMaker->VERSION(6.52) };


sub MY::postamble {
    return <<'END_MAKEFILE';

.PHONY: setup
.PHONY: show-authordeps install-authordeps reinstall-authordeps
.PHONY: show-deps install-deps reinstall-deps
.PHONY: t tv zt format lint build release
.PHONY: cover cover-html cover-compilation cover-nvim cover-all

setup:
	utils/run setup

show-authordeps:
	@dzil authordeps

install-authordeps:
	dzil authordeps --missing | cpm install -g -

reinstall-authordeps:
	dzil authordeps | cpm install -g --reinstall --no-prebuilt -

show-deps:
	@dzil listdeps --develop

install-deps: setup
	dzil listdeps --develop --missing | cpm install -g -

reinstall-deps:
	dzil listdeps --develop | cpm install -g --reinstall --no-prebuilt -

t:
	yath test -j20 --qvf -T --term-width=$$(tput cols 2>/dev/null || echo 80)

tv:
	yath test -j20 --qvf -T \
		--term-width=$$(tput cols 2>/dev/null || echo 80) -v

zt: clean
	dzil test -j20


format:
	@mkdir -p tmp/perltidy
	@files=$$(git ls-files -z | xargs -0 utils/perl-hook list); \
	test -n "$$files" || exit 0; \
	for file in $$files; do cp "$$file" "$$file.tdybak"; done; \
	perlimports --inplace-edit --no-preserve-unused $$files 2>/dev/null \
		|| true; \
	perl -Ilib script/perl-quote-fix --inplace $$files || exit 1; \
	utils/perl-hook format $$files || exit 1; \
	for file in $$files; do \
		if ! diff -q "$$file.tdybak" "$$file" >/dev/null 2>&1; then \
			echo "Formatted $$file"; \
		fi; \
		mv "$$file.tdybak" tmp/perltidy/; \
	done

lint:
	pre-commit run --all-files


build: clean
	dzil build


release:
	utils/run release

cover: build
	cover --delete
	HARNESS_PERL_SWITCHES=-MDevel::Cover=+ignore,^t/ make t

cover-html: cover
	cover --report=html --launch

cover-compilation: cover
	cover --report=compilation

cover-nvim: cover
	cover --report=nvim

cover-all: cover
	cover --report=nvim
	cover --report=compilation

END_MAKEFILE
}

WriteMakefile(%WriteMakefileArgs);
