1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-16 11:11:10 +00:00

refactoring

This commit is contained in:
deadc0de6
2022-09-01 15:26:59 +02:00
parent 76e4563ca9
commit a97dd46d15
4 changed files with 11 additions and 6 deletions

5
docs/usage.md vendored
View File

@@ -60,8 +60,9 @@ Importing `~/.mutt/colors` and then `~/.vim/colors` will result in:
* `d_mutt_colors` and `d_vim_colors` in the long format
A dotfile can be imported as a different file with the use
of the command line switch `--as` (effectively selecting the `src` part
of the dotfile in the config). It is however recommended
of the command line switch `--as` (effectively modifying the `src` part
of the dotfile in the config, that is the location of the dotfile in the
`dotpath`). It is however recommended
to use [templating](templating.md) to avoid duplicates and optimize
dotfile management.
```bash

View File

@@ -308,7 +308,10 @@ class CfgYaml:
return newlink
def resolve_dotfile_src(self, src, templater=None):
"""resolve dotfile src path"""
"""
get abs src file from a relative path
in dotpath
"""
newsrc = ''
if src:
new = src
@@ -340,9 +343,11 @@ class CfgYaml:
def add_dotfile_to_profile(self, dotfile_key, profile_key):
"""
add an existing dotfile key to a profile_key
if profile_key doesn't exist, the profile is created
we test using profiles variable since it merges
imported ones (include, etc) but insert in main
yaml only
return True if was added
"""
# create the profile if it doesn't exist
self._new_profile(profile_key)

View File

@@ -223,8 +223,6 @@ def strip_home(path):
def must_ignore(paths, ignores, debug=False):
"""return true if any paths in list matches any ignore patterns"""
if debug:
LOG.dbg('must_ignore called', force=True)
if not ignores:
return False
if debug:

3
tests.sh vendored
View File

@@ -39,7 +39,7 @@ echo "testing with pylint"
# R0915: too-many-statements
# R0912: too-many-branches
# R0911: too-many-return-statements
# C0209: consider-using-f-string
# R0904: too-many-public-methods
pylint \
--disable=R0902 \
--disable=R0913 \
@@ -48,6 +48,7 @@ pylint \
--disable=R0915 \
--disable=R0912 \
--disable=R0911 \
--disable=R0904 \
dotdrop/
set +e