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

Refactor/improve tes models #24

Merged
merged 8 commits into from
Aug 24, 2024
Merged

Conversation

SalihuDickson
Copy link

@SalihuDickson SalihuDickson commented Aug 24, 2024

Summary by Sourcery

Refactor TES models for improved code quality and consistency, update CI workflow to trigger on all branches, and add Lefthook configuration for pre-commit and pre-push hooks.

Enhancements:

  • Refactor the TES models by reordering imports, improving code formatting, and enhancing docstring consistency.
  • Improve the validation logic in the TESInput model to handle content and URL more robustly.
  • Enhance the CLI tool by updating the command-line interface options to use double quotes for consistency and clarity.

CI:

  • Update the CI workflow to trigger on all branches instead of just the main branch and add conditional execution for the Ruff linting step.

Chores:

  • Add a Lefthook configuration file to set up pre-push and pre-commit hooks for code quality and security checks.

Copy link

sourcery-ai bot commented Aug 24, 2024

Reviewer's Guide by Sourcery

This pull request refactors and improves the TES models in the crategen project. The changes primarily focus on code style improvements, import organization, and minor functional enhancements. The modifications aim to increase code readability, maintainability, and adhere to best practices.

File-Level Changes

Change Details Files
Refactored and improved TES models
  • Reorganized imports for better readability
  • Improved code formatting and indentation
  • Added type hints and docstrings
  • Refactored validation logic for better error handling
  • Standardized string quotes to double quotes
  • Improved error messages for better clarity
crategen/models/tes_models.py
Updated CI workflow configuration
  • Extended branch coverage for CI triggers
  • Added conditional execution for linting step
  • Improved formatting and readability of the workflow file
.github/workflows/ci.yml
Refactored and improved validators
  • Reorganized imports for better readability
  • Improved code formatting and indentation
  • Enhanced error messages for better clarity
  • Refactored validation logic for better maintainability
crategen/validators.py
Refactored CLI implementation
  • Improved code formatting and indentation
  • Enhanced type annotations and docstrings
  • Reorganized imports for better readability
crategen/cli.py
Minor improvements to abstract converter
  • Added blank line for better readability
crategen/converters/abstract_converter.py
Added Lefthook configuration file
  • Introduced Lefthook configuration for git hooks management
lefthook.yml
Added utility functions
  • Implemented convert_to_iso8601 function for timestamp conversion
  • Added convert_to_rfc3339_format function for datetime formatting
crategen/utils.py

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@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.

Hey @SalihuDickson - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

crategen/models/tes_models.py Outdated Show resolved Hide resolved
crategen/utils.py Outdated Show resolved Hide resolved
crategen/validators.py Outdated Show resolved Hide resolved
crategen/validators.py Outdated Show resolved Hide resolved
@SalihuDickson SalihuDickson changed the base branch from config-lefthook to models August 24, 2024 20:45
@SalihuDickson SalihuDickson merged commit 069397f into models Aug 24, 2024
1 check passed
@SalihuDickson SalihuDickson deleted the refactor/improve-tes-models branch August 24, 2024 22:18
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.

1 participant