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

Added conditional_before_commands #51

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

nspielbau
Copy link
Contributor

Resolves #48

Signed-off-by: Niklas Spielbauer <[email protected]>
@nspielbau nspielbau force-pushed the conditional_before_commands branch from de4d9b3 to 4543df7 Compare December 18, 2024 13:11
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.65%. Comparing base (4a12eec) to head (e37d8c0).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #51      +/-   ##
==========================================
+ Coverage   89.24%   89.65%   +0.41%     
==========================================
  Files           6        6              
  Lines         251      261      +10     
==========================================
+ Hits          224      234      +10     
  Misses         27       27              
Flag Coverage Δ
unittests 89.65% <100.00%> (+0.41%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@nspielbau
Copy link
Contributor Author

I tested this locally with the new example_session layout and it seemed to work, the last commit was to fix an issue that is currently not caught by the test coverage tho, but I am not sure why it is not as the session was not created correctly...

catmux/resources/example_session.yaml Outdated Show resolved Hide resolved
catmux/session.py Outdated Show resolved Hide resolved

if "default_window" in common and common["default_window"]:
self._default_window = common["default_window"]

def _parse_before_commands(self, commands):
Copy link
Owner

Choose a reason for hiding this comment

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

Why is parsing before_commands different to commands? Maybe we should unify the concepts? In the end, both should be the same, just parsed from a different section of the config. This would obviously mean that commands would also receive an option to make them conditional, but that's not necessarily a bad thing,

Copy link
Contributor Author

@nspielbau nspielbau Dec 26, 2024

Choose a reason for hiding this comment

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

I agree, we could also extend this to the normal commands but I'll need to have a closer look at that

Sorry for all the editing I got confused :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had a quick look and the command parsing is currently heavily context dependent. In a window with no Splits the directory is created explixitly, otherwise the split data is used.
Either way the directory is parsed in the split run command.

I think it would make sense to have a unfied parsing during the window __init__ either on window or split data and change the Split.run method to accept the command list directly.

This is a larger rework tho so I am not sure if we should create a new PR for that (that maybe gets merged before this one)

Copy link
Owner

Choose a reason for hiding this comment

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

That seems fair to me.

nspielbau and others added 2 commits January 7, 2025 09:03
Co-authored-by: Felix Exner (fexner) <[email protected]>
Signed-off-by: Niklas Spielbauer <[email protected]>
@nspielbau nspielbau mentioned this pull request Jan 13, 2025
@nspielbau nspielbau marked this pull request as draft January 17, 2025 09:13
@nspielbau
Copy link
Contributor Author

Draft until #53 is merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conditional before_commands
2 participants