Skip to content

documentation: add code style to CONTRIBUTING#5649

Open
sueszli wants to merge 2 commits intoxdslproject:mainfrom
sueszli:swiggity-swooty
Open

documentation: add code style to CONTRIBUTING#5649
sueszli wants to merge 2 commits intoxdslproject:mainfrom
sueszli:swiggity-swooty

Conversation

@sueszli
Copy link
Contributor

@sueszli sueszli commented Feb 10, 2026

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.25%. Comparing base (5756ef9) to head (f8d9244).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5649   +/-   ##
=======================================
  Coverage   86.25%   86.25%           
=======================================
  Files         403      403           
  Lines       56660    56660           
  Branches     6512     6512           
=======================================
  Hits        48871    48871           
  Misses       6268     6268           
  Partials     1521     1521           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@superlopuh
Copy link
Member

@alexarice @math-fehr @jumerckx, what do you think of these? These are supposed to be for new contributors and for various coding assistants to hopefully make more consistent choices with the ones we're aiming for when developing in xDSL. Do you agree with all the points? Anything missing?

Comment on lines +196 to +203
- We follow the Python philosophy of
"[ask for forgiveness not permission](https://docs.python.org/3/glossary.html#term-eafp)":
we assume valid keys or attributes exist and catch exceptions if the assumption proves
false. This leads to cleaner, more Pythonic code:

```python
# Good
try:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think I've ever written a try-catch in xDSL, but if people prefer this I'll adapt :)

Copy link
Member

Choose a reason for hiding this comment

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

I relatively recently discovered it and I've tried to stick to it since then

@jumerckx
Copy link
Collaborator

I like these. Makes choices such as preferring to manually inline more explicit

@sueszli
Copy link
Contributor Author

sueszli commented Feb 12, 2026

Whoops - Not sure why the pipeline broke.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants