Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quickstart ignore #19

Open
wants to merge 7 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ TGTest-*
devtools/tests/data/
dist/
build/
\#*\#
.\#*
28 changes: 28 additions & 0 deletions devtools/gearbox/quickstart/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import shutil
import sys
import glob
from subprocess import Popen

from gearbox.template import GearBoxTemplate
from gearbox.command import Command
Expand Down Expand Up @@ -115,6 +116,22 @@ def get_parser(self, prog_name):
help="Disables Kajiki default templates",
action="store_true", dest="skip_default_tmpl", default=False)

parser.add_argument(
"--enable-git",
help="Enables git support: place .gitignore does `git init` and `git add .`",
action="store_true",
dest="git",
default=False,
)

parser.add_argument(
"--enable-mercurial",
help="Enables hg support: place .hgignore does `hg init` and `hg add`",
action="store_true",
dest="hg",
default=False,
)

parser.add_argument("--minimal-quickstart",
help="Throw away example boilerplate from quickstart project",
action="store_true", dest="minimal_quickstart", default=False)
Expand Down Expand Up @@ -276,3 +293,14 @@ def overwrite_templates(template_type):
# remove existing migrations directory
package_migrations_dir = os.path.abspath('migration')
shutil.rmtree(package_migrations_dir, ignore_errors=True)

for vcs in ('hg', 'git'):
if opts.__getattribute__(vcs):
print('Enabling %s support' % vcs)
Popen([vcs, 'init']).wait()
Popen([vcs, 'add', '.']).wait()
print('remember to do:')
print('cd %s && %s commit -m "gearbox quickstarted"' % (opts.name, vcs))
else:
vcs_ignore = '.hgignore' if vcs == 'hg' else '.gitignore'
os.remove(vcs_ignore)
16 changes: 16 additions & 0 deletions devtools/gearbox/quickstart/template/+dot+coveragerc_tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# refer to https://coverage.readthedocs.io/en/latest/config.html
[run]
source = {{package}}

[report]
show_missing = True

# if you don't omit tests directory you have more chances of seeing two tests with same name
# omit = tests/*

# fail test suite if coverage drops below 100% (if you uncomment it)
# this does not work for nosetests, set it in setup.cfg
# fail_under = 100

# Don’t include files in the report that are 100% covered files
skip_covered = True
71 changes: 71 additions & 0 deletions devtools/gearbox/quickstart/template/+dot+gitignore_tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Turbogears files
devdata.db

# tgext.webassets (if plugged)
.webassets-cache

# depot (if used)
{{project}}/depot

# python files
__pycache__/
*.egg-info/
*.py[cod]
.env
.venv
env/
venv/

# tests
.coverage
.coverage.*
coverage.xml
cover/
htmlcov/
.pytest_cache/
.tox/
geckodriver.log


# i18n Translations
*.mo
*.pot


### editors, ide

# emacs files
\#*\#
.\#*
*_flymake.*
flycheck_*.el
.dir-locals.el

# intellij
.idea

# vscode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
.history/


### other tools

# vagrant files
.vagrant/
*.log

# ansible files
*.retry

# type checkers
.mypy_cache/
.dmypy.json
dmypy.json
.pyre/
.pytype/
76 changes: 76 additions & 0 deletions devtools/gearbox/quickstart/template/+dot+hgignore_tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
syntax: glob

# Turbogears files
devdata.db

# tgext.webassets (if plugged)
.webassets-cache
assets/

# depot (if used)
{{project}}/depot

# python files
__pycache__/
*.egg-info/
*.pyc
*.pyo
*.pyd
.env
.venv
env/
venv/

# tests
.coverage
.coverage.*
coverage.xml
cover/
htmlcov/
.pytest_cache/
.tox/
geckodriver.log


# i18n Translations
*.mo
*.pot


### editors, ide

# emacs files
\#*\#
.\#*
*_flymake.*
flycheck_*.el
.dir-locals.el

# intellij
.idea

# vscode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
.history/


### other tools

# vagrant files
.vagrant/
*.log

# ansible files
*.retry

# type checkers
.mypy_cache/
.dmypy.json
dmypy.json
.pyre/
.pytype/
1 change: 1 addition & 0 deletions devtools/gearbox/quickstart/template/setup.cfg_tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ detailed-errors = 1
with-coverage = false
cover-erase = true
cover-package = {{package}}
#cover-min-percentage=100

# Babel configuration
[compile_catalog]
Expand Down