ソースを参照

added `.cleanignore`, for ignoring files during `jlpm run clean:slate``

telamonian 5 年 前
コミット
a96197757d
3 ファイル変更21 行追加6 行削除
  1. 7 0
      .cleanignore
  2. 7 2
      .gitignore
  3. 7 4
      clean.py

+ 7 - 0
.cleanignore

@@ -0,0 +1,7 @@
+# jetbrains IDE stuff
+*.iml
+!**/node_modules/**/*.iml
+.idea/
+
+# ms IDE stuff
+.vscode

+ 7 - 2
.gitignore

@@ -20,7 +20,6 @@ packages/nbconvert-css/style/
 packages/theme-*/static
 node_modules
 .cache
-.vscode
 *.py[co]
 .pytest_cache
 __pycache__
@@ -34,7 +33,6 @@ __pycache__
 
 *.swp
 *.map
-.idea/
 
 coverage/
 tests/**/coverage
@@ -53,3 +51,10 @@ yarn-error.log
 junit.xml
 
 *.tsbuildinfo
+
+# jetbrains IDE stuff
+*.iml
+.idea/
+
+# ms IDE stuff
+.vscode

+ 7 - 4
clean.py

@@ -15,9 +15,12 @@ if os.name == 'nt':
 
 subprocess.check_call('python -m pip uninstall -y jupyterlab'.split(), cwd=here)
 
-git_clean_exclude = [
-    '-e',
-    '/.vscode',
-]
+# get the exclude patterns listed in .cleanignore
+with open(os.path.join(here, '.cleanignore')) as f:
+    git_clean_exclude = [f'--exclude={stripped}'
+                         for stripped in
+                         (line.strip() for line in f)
+                         if stripped and not stripped.startswith('#')]
+
 git_clean_command = ['git', 'clean', '-dfx'] + git_clean_exclude
 subprocess.check_call(git_clean_command, cwd=here)