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

gdsfactory8 upcoming new major release #2779

Merged
merged 36 commits into from
May 24, 2024
Merged

gdsfactory8 upcoming new major release #2779

merged 36 commits into from
May 24, 2024

Conversation

joamatab
Copy link
Contributor

@joamatab joamatab commented May 22, 2024

  • fixes docs and many tests for upcoming new major release

@github-actions github-actions bot added the bug Something isn't working label May 22, 2024
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.

Comment on lines +72 to +73
if check:
data_regression.check(lengths)
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (code-quality): Avoid conditionals in tests. (no-conditionals-in-tests)

ExplanationAvoid complex code, like conditionals, in test functions.

Google's software engineering guidelines says:
"Clear tests are trivially correct upon inspection"
To reach that avoid complex code in tests:

  • loops
  • conditionals

Some ways to fix this:

  • Use parametrized tests to get rid of the loop.
  • Move the complex logic into helpers.
  • Move the complex part into pytest fixtures.

Complexity is most often introduced in the form of logic. Logic is defined via the imperative parts of programming languages such as operators, loops, and conditionals. When a piece of code contains logic, you need to do a bit of mental computation to determine its result instead of just reading it off of the screen. It doesn't take much logic to make a test more difficult to reason about.

Software Engineering at Google / Don't Put Logic in Tests

@github-actions github-actions bot added the documentation Improvements or additions to documentation label May 22, 2024
@joamatab joamatab changed the title Fix routing Fix docs for upcoming new major release May 23, 2024
@joamatab joamatab changed the title Fix docs for upcoming new major release gdsfactory8 upcoming new major release May 24, 2024
@joamatab joamatab merged commit f46ac2c into main May 24, 2024
9 of 16 checks passed
@joamatab joamatab deleted the fix_routing branch May 24, 2024 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant