/
.info.cfg
295 lines (272 loc) · 9.21 KB
/
.info.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
#!/usr/bin/env bash
# TODO This will most likely end up being a json file eventually ...
# This information is required for script functionality ...
# version='x.y.z' (e.g. '0.7.2')
# name='xxxxx' (e.g. 'auto_ci')
# detail='xxxxx' (e.g. 'automatic handling of CI context')
version='0.0.1'
name='html_trim'
detail="html formatting automation for macOS"
description="$name : $detail (version $version)"
author='Michael Treanor <skeptycal@gmail.com>'
copyright='2019 (c) Michael Treanor'
license='MIT <https://opensource.org/licenses/MIT>'
github='https://www.github.com/skeptycal'
portfolio='https://www.skeptycal.com'
twitter='https://www.twitter.com/skeptycal'
generic_usage="###############################################################################
# $description
# author - $author
# copyright - $copyright
# license - $license
# github - $github
# Usage: $name {init|reset|version|help}
# Parameters:
# init, -i, --init -- install and initialize
# reset, -r, --reset -- reset initial repo files (with backup)
# version, -v, --version -- display version information
# help, -h, --help -- display usage and information"
###############################################################################
# Specific utility and CI blurbs:
# ######### pre-commit #########
# pre-commit specific usage
program_usage="
$generic_usage
# .pre-commit-template.yaml must be in current directory
# If not, a generic template will be created
# .pre-commit-bak.yaml will be created (if possible)
# from .pre-commit-config.yaml as backup
# .pre-commit-config.yaml will be *overwritten*
# and updated to current master sha from GitHub
###############################################################################
"
# pre-commit specific instructions
program_instructions="$program_usage
# Run this script if changes to the pre-commit or yaml configuration are added.
# Please make changes directly to the 'template' file:
# <.pre\-commit-template.yaml>
# and run the script 'pc' to update the yaml to current versioning.
# Please do not make changes directly to the 'config' file. The 'config' file:
# <.pre-commit-config.yaml>
# is created and updated by the 'pc' script automatically in order to maintain
# the correct, current versioning from git (master sha) so changes to the
# commit file will be overwritten when updating.
###############################################################################
"
# Sample template used if none is found in a new pre-commit install
# reference: https://github.com/hootsuite/pre-commit-php
sample_settings_template=$program_instructions'
# Pre-commit Sample yaml template
default_language_version:
python: python3.7
default_stages: [commit, push]
exclude: "^$"
fail_fast: false
# @see http://pre-commit.com/
repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
sha: master
hooks:
- id: check-yaml
files: \.(yaml|yml)$
- id: check-added-large-files
- id: check-byte-order-marker
- id: check-docstring-first
- id: check-case-conflict
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
# - id: detect-aws-credentials
- id: detect-private-key
- id: end-of-file-fixer
- id: flake8
args: [--max-line-length=79]
- id: pretty-format-json
- id: requirements-txt-fixer
- id: trailing-whitespace
# Python settings ... replace as needed
- repo: git://github.com/pre-commit/mirrors-pylint
sha: master
hooks:
- id: pylint
# PHP settings ... replace as needed
# - repo: git@github.com:hootsuite/pre-commit-php.git
# sha: 1.1.0
# hooks:
# - id: php-lint-all
# - id: php-unit
# - id: php-cs
# files: \.(php)$
# args: [--standard=PSR1 -p]
# - id: php-cbf
# files: \.(php)$
# args: [--standard=PSR1 -p]
# The tool will fail a build when it has made changes to the staged files. This allows a developer to do a git diff and examine the changes that it has made. Remember that you may omit this if needed with a SKIP=php-cs-fixer git commit.
# - id: php-cs-fixer
# files: \.(php)$
# args: [--level=PSR2]
'
# Travis CI yml
travis_yml='# Travis CI scripts (python, php)
# Python script (other languages are at the end.)
language: python
python:
- "2.7"
- "3.5"
- "3.6"
# PyPy versions
- "pypy3.5"
# Django Stuff:
# env:
# - DJANGO_VERSION=1.10.8
# - DJANGO_VERSION=1.11.5
# install:
# - pip install -q Django==$DJANGO_VERSION
# - python setup.py -q install
# command to install dependencies
install:
# Default ...
# - pip install -r requirements.txt
# - pip install .
# Specific ...
- pip install -e .
# Limit setuptools as some newer versions have Issues(tm). This needs doing
# as its own step; trying to do it via requirements.txt isn''t always
# sufficient.
- pip install "setuptools<34"
# Dev requirements
# TODO: follow invoke and split it up a bit so we''re not pulling down
# conflicting or unused-by-travis deps?
- pip install -r dev-requirements.txt
# command to run tests
script: pytest
after_success:
# Upload coverage data to codecov
- codecov
notifications:
# irc:
# channels: "irc.freenode.org#xxxxx"
# template:
# - "%{repository_name}@%{branch}: %{message} (%{build_url})"
# on_success: change
# on_failure: change
email: skeptycal@gmail.com
##
# PHP script
# Required to run your project under the correct environment.
language: php
# Versions of PHP you want your project run with.
php:
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- hhvm
# Commands to be run before your environment runs.
before_script:
- composer self-update
- composer install --prefer-source --no-interaction --dev
# Commands you want to run that will verify your build.
script: phpunit
# allow_failures: Allow this build to fail under the specified environments.
# fast_finish: If your build fails do not continue trying to build, just stop.
matrix:
allow_failures:
- php: 5.6
- php: hhvm
fast_finish: true
# Customize when the notification emails are sent.
notifications:
on_success: never
on_failure: always
# Project language
# language: php
# # Allows use container-based infrastructure
# sudo: false
# # Start mysql service
# services:
# - mysql
# # Cache composer packages so "composer install" is faster
# cache:
# directories:
# - $HOME/.composer/cache/files
# # Matrix to test in every php version
# matrix:
# # Fast finish allows to set the build as "finished" even if the "allow_failures" matrix elements are not finished yet.
# fast_finish: true
# include:
# - php: 5.5
# - php: 5.6
# - php: 7.0
# - php: hhvm
# allow_failures:
# - php: hhvm
# # Define an environment variable
# env:
# - SYMFONY_VERSION="3.0.*" DB=mysql
# # Update composer
# before-install:
# - composer self-update
# # Install composer dependencies,
# # Create database, schema and fixtures
# install:
# - composer install
# - cp app/config/parameters.yml.dist app/config/parameters.yml
# - php bin/console doctrine:database:create --env=test
# - php bin/console doctrine:schema:create --env=test
# - php bin/console doctrine:fixtures:load -n --env=test
# # Run script
# script:
# - phpunit
# after_success:
# # Upload coverage data to codecov
# - codecov
# # After a build, send email notification with the build results
# notifications:
# # irc:
# # channels: "irc.freenode.org#xxxxx"
# # template:
# # - "%{repository_name}@%{branch}: %{message} (%{build_url})"
# # on_success: change
# # on_failure: change
# email: skeptycal@gmail.com
'
###############################################################################
# References:
# automating pre-commit hooks for Git and GitHub
#
# instructions found on https://github.com/pre-commit/pre-commit/issues/366
# Correct solution from this post:
# Author: Tom Hensel (https://github.com/gretel)
# The value of sha should not be master or HEAD. Either one will only match
# the latest version at install time and prevent subsequent auto updates. On
# GitHub, the id of the most recent commit can be looked up easily (i.e.
# commit/master).
# Alternatively, setting sha to master and running pre-commit autoupdate
# before anything else will automatically populate the values of the sha keys
# in the configuration file. Example:
# - repo: meta
# - hooks:
# - id: check-hooks-apply, check-useless-excludes, identity
# - repo: git://github.com/pre-commit/pre-commit-hooks
# sha: master #* <-- These lines are what is needed
# hooks:
# - id: check-added-large-files
# ...
# - id: trailing-whitespace
# - repo: git://github.com/pre-commit/mirrors-pylint
# sha: master #* <-- These lines are what is needed
# hooks:
# - id: pylint
# Running `pre-commit autoupdate` updates this to:
# - repo: git://github.com/pre-commit/pre-commit-hooks
# sha: 35548254adb636ce52b5574eb1904b8c795b673e # * <-- something similar
# hooks:
# - id: check-added-large-files
# ...
# - id: trailing-whitespace
# - repo: git://github.com/pre-commit/mirrors-pylint
# sha: 4de6c8dfadef1a271a814561ce05b8bc1c446d22 # * <-- something similar
# hooks:
# - id: pylint