Origen-SDK / o2

MIT License
4 stars 0 forks source link

Added fmt and update commands #110

Closed ginty closed 4 years ago

ginty commented 4 years ago

Adds an origen fmt command which will code format (similar to O1 lint command) all Python files and when in an o2 development workspace it will do all Python and Rust files.

Will probably add app config options in future to allow apps to configure files/dirs to exclude, but for now it just does everything.

origen::STATUS can also now be interogated to determine if Origen is executing within an o2 workspace or not.

I added an additional command origen update which is to be used to update an app's Python dependencies, similar to running bundle update in O1. This is just a thin wrapper around the underlying poetry command.

This fmt tool requires a new Python package, so to run it in an existing workspace you must first run origen update within the example app.

I haven't run the tool on this source code yet because it will introduce a lot of diffs in the Python code. Once this is merged I will run it on master and that will give folks an easy-ish path to merge into their branches:

ginty commented 4 years ago

Actually, just running origen setup in an existing workspace with this update might be sufficient. I think origen update is only required when you add/change pyproject.toml and want to update the lock file accordingly.

ginty commented 4 years ago

Thanks @pderouen, @coreyeng any objections to merging this?

pderouen commented 4 years ago

I don't see any issue with merging it.