File tree Expand file tree Collapse file tree
mkdocstrings/handlers/crystal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,17 +112,18 @@ def substitute(self, location: DocLocation) -> str:
112112 )
113113
114114 @property
115- def shard_version (self ):
115+ def shard_version (self ) -> str :
116116 return self ._shard_version (os .path .dirname (self .src_path ))
117117
118118 @classmethod
119119 @functools .lru_cache (maxsize = None )
120- def _shard_version (cls , path : str ):
120+ def _shard_version (cls , path : str ) -> str :
121121 file_path = _find_above (path , "shard.yml" )
122122 with open (file_path , "rb" ) as f :
123123 m = re .search (rb"^version: *([\S+]+)" , f .read (), flags = re .MULTILINE )
124124 if not m :
125125 raise PluginError (f"`version:` not found in { file_path !r} " )
126+ return m [1 ].decode ()
126127
127128
128129def _find_above (path : str , filename : str ) -> str :
@@ -143,7 +144,7 @@ def crystal_version(self) -> str:
143144 ).rstrip ()
144145
145146 @cached_property
146- def crystal_src (self ):
147+ def crystal_src (self ) -> str :
147148 out = subprocess .check_output (["crystal" , "env" , "CRYSTAL_PATH" ], text = True ).rstrip ()
148149 for path in out .split (os .pathsep ):
149150 if os .path .isfile (os .path .join (path , "prelude.cr" )):
You can’t perform that action at this time.
0 commit comments