From a97dd46d157f51b70ff84aee079ab7baf3d86d21 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Thu, 1 Sep 2022 15:26:59 +0200 Subject: [PATCH] refactoring --- docs/usage.md | 5 +++-- dotdrop/cfg_yaml.py | 7 ++++++- dotdrop/utils.py | 2 -- tests.sh | 3 ++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 8b1ceee..b5383a4 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -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 diff --git a/dotdrop/cfg_yaml.py b/dotdrop/cfg_yaml.py index c901a1c..1b32e21 100644 --- a/dotdrop/cfg_yaml.py +++ b/dotdrop/cfg_yaml.py @@ -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) diff --git a/dotdrop/utils.py b/dotdrop/utils.py index 54c0bd9..3a26b14 100644 --- a/dotdrop/utils.py +++ b/dotdrop/utils.py @@ -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: diff --git a/tests.sh b/tests.sh index 8ccf00d..ef1ebdd 100755 --- a/tests.sh +++ b/tests.sh @@ -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