Skip to content

Commit

Permalink
Merge pull request #166 from facundobatista/dont-ignore-version
Browse files Browse the repository at this point in the history
Don't ignore important files (like version) by default.
  • Loading branch information
facundobatista authored Sep 28, 2020
2 parents 0708b33 + 96b276f commit 39a7af5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion charmcraft/jujuignore.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ def match(self, path: str, is_dir: bool) -> bool:

# default_juju_ignore is the initial set of ignores.
# juju itself always includes these before adding the contents of .jujuignore
# NOTE that this diverges from Juju ignore list, which also ignores "version",
# because we need the version file to populate the store
default_juju_ignore = '''
.git
.svn
Expand All @@ -220,7 +222,6 @@ def match(self, path: str, is_dir: bool) -> bool:
/build/
/revision
/version
.jujuignore
'''.split('\n')
6 changes: 6 additions & 0 deletions tests/test_jujuignore.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
from charmcraft import jujuignore


def test_default_important_files():
"""Don't ignore important files by default."""
ignore = jujuignore.JujuIgnore(jujuignore.default_juju_ignore)
assert not ignore.match('version', is_dir=False)


def test_jujuignore_only_dir():
ignore = jujuignore.JujuIgnore(['target/'])
assert ignore.match('target', is_dir=True)
Expand Down

0 comments on commit 39a7af5

Please sign in to comment.