@@ -77,7 +77,7 @@ def _create_document_from_lockfile(
7777 Args:
7878 document: Original document (package.json).
7979 lockfile_path: Path to the existing lockfile.
80-
80+
8181 Returns:
8282 Document with lockfile content if successful, None otherwise.
8383 """
@@ -96,20 +96,20 @@ def _create_document_from_lockfile(
9696 {'path' : document .path , 'lockfile' : lock_file_name , 'content_size' : len (restore_file_content )},
9797 )
9898 return Document (relative_restore_file_path , restore_file_content , self .is_git_diff )
99- else :
100- logger .warning (
101- 'Lockfile exists but could not read content, %s' ,
102- {'path' : document .path , 'lockfile' : lock_file_name , 'lockfile_path' : lockfile_path },
103- )
104- return None
99+
100+ logger .warning (
101+ 'Lockfile exists but could not read content, %s' ,
102+ {'path' : document .path , 'lockfile' : lock_file_name , 'lockfile_path' : lockfile_path },
103+ )
104+ return None
105105
106106 def try_restore_dependencies (self , document : Document ) -> Optional [Document ]:
107107 """Override to prevent npm install when any lockfile exists.
108108
109109 The base class uses document.absolute_path which might be None or incorrect.
110110 We need to use the same path resolution logic as get_manifest_file_path()
111111 to ensure we check for lockfiles in the correct location.
112-
112+
113113 If any lockfile exists (package-lock.json, pnpm-lock.yaml, yarn.lock, deno.lock),
114114 we use it directly without running npm install to avoid generating invalid lockfiles.
115115 """
@@ -128,7 +128,8 @@ def try_restore_dependencies(self, document: Document) -> Optional[Document]:
128128 return super ().try_restore_dependencies (document )
129129
130130 # Check for existing lockfiles
131- logger .debug ('Checking for existing lockfiles in directory, %s' , {'directory' : manifest_dir , 'path' : document .path })
131+ logger .debug ('Checking for existing lockfiles in directory, %s' ,
132+ {'directory' : manifest_dir , 'path' : document .path })
132133 existing_lock_file , checked_lockfiles = self ._find_existing_lockfile (manifest_dir )
133134
134135 logger .debug (
@@ -176,6 +177,5 @@ def prepare_manifest_file_path_for_command(manifest_file_path: str) -> str:
176177 # Handle both cases: with separator (e.g., '/path/to/package.json') and without (e.g., 'package.json')
177178 if os .sep in manifest_file_path :
178179 return manifest_file_path .replace (os .sep + NPM_MANIFEST_FILE_NAME , '' )
179- else :
180- return ''
180+ return ''
181181 return manifest_file_path
0 commit comments