Repository: spyder-ide/spyder
Pull request: PR: Make Editor annotations work in lower case
<!--- Make sure to read the Contributing Guidelines:                   --->
<!--- https://github.com/spyder-ide/spyder/blob/master/CONTRIBUTING.md --->
<!--- and follow PEP 8, PEP 257 and Spyder's code style:               --->
<!--- https://github.com/spyder-ide/spyder/wiki/Dev:-Coding-Style      --->

## Description of Changes



<!--- Explain what you've done and why --->

Make Editor annotations work in lower case


### Issue(s) Resolved

<!--- List the issue(s) below, in the form "Fixes #1234"; one per line --->

Fixes #22341


### Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the [Developer Certificate of Origin](https://developercertificate.org)
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

<!--- TYPE YOUR USER/NAME AFTER THE FOLLOWING: --->
I certify the above statement is true and correct:
@jsbautista 
<!--- Thanks for your help making Spyder better for everyone! --->


Problem statement:
Make Editor annotations work in lower case
<!--- **PLEASE READ:** When submitting here, please ensure you've completed the following checklist and checked the boxes to confirm. Issue reports without it may be closed. Thanks! --->


## Problem Description

editor code annotations (available via preferences > editor > advanced settings) only display a marker to the left of line number when case matches. 


### What steps reproduce the problem?

1. go to preferences > editor > advanced settings check annotations box, apply and close dialog
2. go to source editor and create a line "# TODO" and wait a second until a check marker appear left to line number
3. change the line to "# todo"and wait for a second, the marker will disappear

### What is the expected output? What do you see instead?

the marker should not disappear, the application logic should be changed to be case insensitive


### Paste Traceback/Error Below (if applicable)
na.

## Versions

* Spyder version: 5.5.5  (pip)
* Python version: 3.10.12 64-bit
* Qt version: 5.15.2
* PyQt5 version: 5.15.9
* Operating System: Linux-5.15.0-118-generic-x86_64-with-glibc2.35


### Dependencies
na.

Hints from issue discussion:
Hi @kr-g thank you for the feedback! I think `@todo` should trigger a marker too, kind of like a workaround but is that an option for you? Or maybe in general you would like for all the annotations that trigger a mark to be case insentive? So instead of the mark being triggered by only `TODO`, `FIXME`, `XXX`, `HINT`, `TIP`, `@todo`, `HACK`, `BUG`, `OPTIMIZE`, `!!!`, and `???` to be also triggered by  `todo`, `fixme`, `xxx`, `hint`, `tip`, `@TODO`, `hack`, `bug` and `optimize`? 

What do you think @spyder-ide/core-developers ?
I think this is a good idea 👍🏽 
I this is a good idea, also. 👍🏼

Commit message: Make Editor annotations work in lower case

Patch to review:
diff --git a/spyder/plugins/editor/utils/findtasks.py b/spyder/plugins/editor/utils/findtasks.py
index 1e7ce44716c..8928bfabe39 100644
--- a/spyder/plugins/editor/utils/findtasks.py
+++ b/spyder/plugins/editor/utils/findtasks.py
@@ -18,8 +18,9 @@
 # =============================================================================
 # Find tasks - TODOs
 # =============================================================================
-TASKS_PATTERN = r"(^|#)[ ]*(TODO|FIXME|XXX|HINT|TIP|@todo|" \
-                r"HACK|BUG|OPTIMIZE|!!!|\?\?\?)([^#]*)"
+TASKS_PATTERN = r"(^|#)[ ]*(TODO|todo|FIXME|fixme|XXX|xxx|HINT|hint|" \
+                r"TIP|tip|@todo|@TODO|HACK|hack|BUG|bug|OPTIMIZE|" \
+                r"optimize|!!!|\?\?\?)([^#]*)"
 
 
 def find_tasks(source_code):


Code review comments:
diff_hunk: @@ -18,8 +18,9 @@
 # =============================================================================
 # Find tasks - TODOs
 # =============================================================================
-TASKS_PATTERN = r"(^|#)[ ]*(TODO|FIXME|XXX|HINT|TIP|@todo|" \
-                r"HACK|BUG|OPTIMIZE|!!!|\?\?\?)([^#]*)"
+TASKS_PATTERN = r"(^|#)[ ]*(TODO|todo|FIXME|fixme|XXX|xxx|HINT|hint|" \
+                r"TIP|tip|@todo|@TODO|HACK|hack|BUG|bug|OPTIMIZE|" \
+                r"optimize|!!!|\?\?\?)([^#]*)"
path: spyder/plugins/editor/utils/findtasks.py
text: @user3:
```suggestion
TASKS_PATTERN = (
    r"(^|#)[ ]*(TODO|todo|FIXME|fixme|XXX|xxx|HINT|hint|TIP|tip|@user1|@user2|"
    r"HACK|hack|BUG|bug|OPTIMIZE|optimize|!!!|\?\?\?)([^#]*)"
)
```

Improve code formatting.