ocean icon indicating copy to clipboard operation
ocean copied to clipboard

[Core] Add pep8 linter

Open Tankilevitch opened this issue 8 months ago • 3 comments

User description

Description

What - Added linting for naming convention and pep8 conventions

Why -

How -

Type of change

Please leave one option from the following and delete the rest:

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] New Integration (non-breaking change which adds a new integration)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Non-breaking change (fix of existing functionality that will not change current behavior)
  • [ ] Documentation (added/updated documentation)

All tests should be run against the port production environment(using a testing org).

Core testing checklist

  • [ ] Integration able to create all default resources from scratch
  • [ ] Resync finishes successfully
  • [ ] Resync able to create entities
  • [ ] Resync able to update entities
  • [ ] Resync able to detect and delete entities
  • [ ] Scheduled resync able to abort existing resync and start a new one
  • [ ] Tested with at least 2 integrations from scratch
  • [ ] Tested with Kafka and Polling event listeners
  • [ ] Tested deletion of entities that don't pass the selector

Integration testing checklist

  • [ ] Integration able to create all default resources from scratch
  • [ ] Resync able to create entities
  • [ ] Resync able to update entities
  • [ ] Resync able to detect and delete entities
  • [ ] Resync finishes successfully
  • [ ] If new resource kind is added or updated in the integration, add example raw data, mapping and expected result to the examples folder in the integration directory.
  • [ ] If resource kind is updated, run the integration with the example data and check if the expected result is achieved
  • [ ] If new resource kind is added or updated, validate that live-events for that resource are working as expected
  • [ ] Docs PR link here

Preflight checklist

  • [ ] Handled rate limiting
  • [ ] Handled pagination
  • [ ] Implemented the code in async
  • [ ] Support Multi account

Screenshots

Include screenshots from your environment showing how the resources of the integration will look.

API Documentation

Provide links to the API documentation used for this integration.


PR Type

Enhancement, Bug fix, Tests


Description

  • Standardized exception naming by replacing Exception suffix with Error.

  • Refactored code to align with PEP8 conventions and added @classmethod decorators.

  • Updated pyproject.toml to include naming convention rules and exclude unnecessary directories.

  • Adjusted test cases to reflect updated exception names.


Changes walkthrough 📝

Relevant files
Bug fix
15 files
client.py
Renamed exceptions for Kafka credentials handling.             
+2/-2     
integrations.py
Updated exception name for defaults provisioning.               
+2/-2     
ocean.py
Fixed naming convention for webhook manager.                         
+1/-1     
common.py
Renamed exception for unsupported default file types.       
+2/-2     
factory.py
Updated exception for unsupported event listener types.   
+2/-2     
order_by_entities_dependencies.py
Renamed exception for cyclic dependencies.                             
+2/-2     
jq_entity_processor.py
Updated exception for entity processor errors.                     
+2/-2     
base.py
Renamed exception for already started integrations.           
+2/-2     
handler.py
Updated exception for uninitialized handlers.                       
+4/-4     
sync_raw.py
Renamed exception for aborting operations.                             
+3/-3     
utils.py
Updated exception handling for resync operations.               
+8/-8     
entity_topological_sorter.py
Renamed exception for cyclic dependencies in sorting.       
+2/-2     
utils.py
Updated exception for validation errors.                                 
+4/-4     
middlewares.py
Updated middleware exception handling.                                     
+3/-3     
ocean.py
Fixed naming convention for webhook manager.                         
+2/-2     
Enhancement
12 files
settings.py
Added `@classmethod` for root validators.                               
+4/-0     
applier.py
Fixed variable naming to align with conventions.                 
+4/-4     
models.py
Fixed naming convention for model fields.                               
+1/-1     
api.py
Renamed API exceptions to align with naming conventions. 
+3/-3     
base.py
Standardized base exception naming.                                           
+1/-1     
clients.py
Renamed client-related exceptions.                                             
+3/-3     
context.py
Updated context-related exceptions.                                           
+2/-2     
core.py
Standardized core exception naming.                                           
+10/-10 
port_defaults.py
Renamed exceptions for port defaults.                                       
+4/-4     
utils.py
Updated signal handler exceptions.                                             
+3/-3     
handlers.py
Fixed method naming convention.                                                   
+1/-1     
signal.py
Renamed signal handler exceptions.                                             
+6/-4     
Tests
4 files
test_jq_entity_processor.py
Updated test cases for renamed exceptions.                             
+2/-2     
test_sync_raw.py
Adjusted tests for renamed exceptions.                                     
+2/-2     
test_utils.py
Updated tests for integration runtime validation.               
+2/-2     
test_entity_topological_sorter.py
Adjusted tests for cyclic dependency exceptions.                 
+3/-3     
Configuration changes
1 files
pyproject.toml
Added PEP8 naming rules and updated exclusions.                   
+11/-3   

Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Tankilevitch avatar Feb 17 '25 20:02 Tankilevitch