File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 3030 curl -sSL https://install.python-poetry.org | python3 -
3131 echo "$HOME/.local/bin" >> $GITHUB_PATH
3232
33+ - name : Install poetry export plugin
34+ run : |
35+ poetry self add poetry-plugin-export
36+
3337 - name : Install dependencies and export requirements
3438 run : |
3539 poetry install
Original file line number Diff line number Diff line change @@ -107,7 +107,9 @@ def max_name_length(self) -> int:
107107 @max_name_length .setter
108108 def max_name_length (self , value : int ) -> None :
109109 """Set maximum name length."""
110- if not isinstance (value , int ) or value <= 0 :
110+ if not isinstance (value , int ):
111+ raise TypeError ("Max name length must be an integer" )
112+ if value <= 0 :
111113 raise ValueError ("Max name length must be a positive integer" )
112114 self ._config ["max_name_length" ] = value
113115
Original file line number Diff line number Diff line change @@ -208,12 +208,19 @@ def format_greeting(
208208 if uppercase :
209209 result = result .upper ()
210210
211- # Apply truncation if needed - fix the logic here
212- if max_length and len (result ) > max_length :
211+ # Apply truncation if needed - ensure we include part of the name
212+ if max_length is not None and len (result ) > max_length :
213213 if max_length <= 3 :
214214 result = "..."
215215 else :
216- result = result [:max_length - 3 ] + "..."
216+ # Make sure we get some of the name in there
217+ # Format: "greeting, na..."
218+ greeting_part = f"{ greeting } , "
219+ available_for_name = max_length - len (greeting_part ) - 3 # 3 for "..."
220+ if available_for_name > 0 :
221+ result = greeting_part + name [:available_for_name ] + "..."
222+ else :
223+ result = result [:max_length - 3 ] + "..."
217224
218225 return result
219226
You can’t perform that action at this time.
0 commit comments