From 89b164eeaadef0596cd21b2e989e09af9ea57c2c Mon Sep 17 00:00:00 2001 From: Sourish Dutta Sharma Date: Tue, 3 Mar 2026 12:42:23 +0530 Subject: [PATCH] Style: Add Python type hints to overwrite, verbosity, and legal_name in core.py --- python/grass/script/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/grass/script/core.py b/python/grass/script/core.py index 6ee8e0f987f..9e0b0be406a 100644 --- a/python/grass/script/core.py +++ b/python/grass/script/core.py @@ -1839,7 +1839,7 @@ def parse_color( # check GRASS_OVERWRITE -def overwrite(): +def overwrite() -> bool: """Return True if existing files may be overwritten""" owstr = "GRASS_OVERWRITE" return owstr in os.environ and os.environ[owstr] != "0" @@ -1848,7 +1848,7 @@ def overwrite(): # check GRASS_VERBOSE -def verbosity(): +def verbosity() -> int: """Return the verbosity level selected by GRASS_VERBOSE Currently, there are 5 levels of verbosity: @@ -2212,7 +2212,7 @@ def debug_level(force: bool = False, *, env: _Env = None): # TODO: Remove the pygrass backwards compatibility version of it? -def legal_name(s): +def legal_name(s: str) -> bool: """Checks if the string contains only allowed characters. This is the Python implementation of :func:`G_legal_filename()` function.