Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove double negations for checkCancellation function #98

Merged
merged 1 commit into from
Feb 15, 2025

Conversation

Seb-Ltz
Copy link
Contributor

@Seb-Ltz Seb-Ltz commented Feb 13, 2025

Remove double negations for checkCancellation function

♻️ Current situation & Problem

As mentionned in issue #83 as well as in the PR #81 (discussion), the SpeziLLM package is currently using a double negation (guard followed by !) for every checkCancellation() function call. As double negations make the code harder to read, we could use if instead.

⚙️ Release Notes

  • Remove the double negations for checkCancellation by replacing the guard statements that are followed by a not operator into an if statement.

📝 Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@LeonNissen
Copy link
Contributor

Nice work @Seb-Ltz! LGTM 🚀

Copy link
Member

@philippzagar philippzagar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great @Seb-Ltz, thanks for the quick fix!

@philippzagar
Copy link
Member

@Seb-Ltz Seems like the Vision Pro UI tests timed out in the CI (sometimes happens, I retriggered the job, should hopefully pass in the second run.

@philippzagar
Copy link
Member

Closes #83

Copy link

codecov bot commented Feb 15, 2025

Codecov Report

Attention: Patch coverage is 25.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 39.12%. Comparing base (4a86cbf) to head (2accced).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...urces/SpeziLLMLocal/LLMLocalSession+Generate.swift 0.00% 2 Missing ⚠️
...s/SpeziLLMOpenAI/LLMOpenAISession+Generation.swift 0.00% 2 Missing ⚠️
Sources/SpeziLLMLocal/LLMLocalSession.swift 0.00% 1 Missing ⚠️
Sources/SpeziLLMOpenAI/LLMOpenAISession.swift 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #98   +/-   ##
=======================================
  Coverage   39.12%   39.12%           
=======================================
  Files          64       64           
  Lines        2357     2357           
=======================================
  Hits          922      922           
  Misses       1435     1435           
Files with missing lines Coverage Δ
Sources/SpeziLLM/Mock/LLMMockSession.swift 78.19% <100.00%> (ø)
Sources/SpeziLLMLocal/LLMLocalSession.swift 0.00% <0.00%> (ø)
Sources/SpeziLLMOpenAI/LLMOpenAISession.swift 22.86% <0.00%> (ø)
...urces/SpeziLLMLocal/LLMLocalSession+Generate.swift 0.00% <0.00%> (ø)
...s/SpeziLLMOpenAI/LLMOpenAISession+Generation.swift 0.00% <0.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4a86cbf...2accced. Read the comment docs.

@philippzagar philippzagar merged commit 3f26ab4 into StanfordSpezi:main Feb 15, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants