regro / regolith

Research Group Content Managment System
http://regro.github.io/regolith-docs/
Other
15 stars 71 forks source link

Fix import not used and E501 issues #1084

Closed stevenhua0320 closed 5 months ago

stevenhua0320 commented 5 months ago

I leave E722 for check, which is do not leave bare except. However, the code structure is like this:

截屏2024-07-05 上午1 16 34
sbillinge commented 5 months ago

For this one, please can you try and run tests and make sure they pass? Let me know here on the PR and when tests pass I can merge.

for the E722, I am not sure how that would fail and raise an exception. I will try and play with it a bit.

sbillinge commented 5 months ago

@stevenhua0320 I think we can just remove that try except clause, so it becomes

            if index:
                task["preamble"] = (
                    f"({task.get('importance')})({task.get('days_to_due')} days): ({task.get('running_index', 0)}) "
                )
            else:
                task["preamble"] = ""
stevenhua0320 commented 5 months ago

@stevenhua0320 I think we can just remove that try except clause, so it becomes

            if index:
                task["preamble"] = (
                    f"({task.get('importance')})({task.get('days_to_due')} days): ({task.get('running_index', 0)}) "
                )
            else:
                task["preamble"] = ""

yeah, I think the code here should be an if statement, then it could pass. Let me try it and if it works, I would push it.

sbillinge commented 5 months ago

the if statement was already there. I just removed the try/except

sbillinge commented 5 months ago

@stevenhua0320 please confirm that this is passing tests and I can merge it.

stevenhua0320 commented 5 months ago

Yes, I have verified that it is a passing test.