Skip to content

Conversation

@onefloid
Copy link
Collaborator

@onefloid onefloid commented Sep 13, 2025

Description

This PR adds the ruff linter to the project and fix all rule viloations.

Before

(.venv) > ruff check --statistics
136     F401    [ ] unused-import
 25     F541    [*] f-string-missing-placeholders
  9     F811    [ ] redefined-while-unused
  5     F841    [ ] unused-variable
  3     E722    [ ] bare-except
  2     F403    [ ] undefined-local-with-import-star
  2     F821    [ ] undefined-name
  1     E712    [ ] true-false-comparison
  1     E731    [ ] lambda-assignment
  1     F522    [*] string-dot-format-extra-named-arguments        
Found 185 errors.

All violations were fixed

(.venv) >  ruff check --statistics

@MariusWirtz MariusWirtz requested a review from Copilot September 14, 2025 11:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces the Ruff linter to the project to improve code quality and enforces Python coding standards. The changes address 45 linting violations by removing unused imports, fixing f-string formatting issues, correcting comparison operations, and organizing imports alphabetically.

  • Adds Ruff configuration to pyproject.toml with Python 3.7 target and specific exclusions
  • Fixes f-string violations by removing unnecessary f-string prefixes where no placeholders are used
  • Removes unused imports and reorganizes remaining imports alphabetically

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
setup.py Adds ruff to dev dependencies and reformats extras_require for better readability
pyproject.toml Configures Ruff linter with target version, exclusions, and ignored rules
Tests/Utils_test.py Reorganizes imports alphabetically and removes unused imports
Tests/SecurityService_test.py Removes unused import case_and_space_insensitive_equals
Tests/ManageService_test.py Removes unused imports random, string, and skip_if_version_lower_than
Tests/CellService_test.py Fixes f-string formatting by removing unnecessary f prefixes
TM1py/init.py Removes unused JobService import
TM1py/Utils/MDXUtils.py Fixes f-string formatting in deprecation warnings
TM1py/Services/init.py Removes unused GitService import
TM1py/Services/UserService.py Removes unused deprecated_in_version import
TM1py/Services/SubsetService.py Fixes f-string formatting in error message
TM1py/Services/ServerService.py Removes unused pytz import
TM1py/Services/SandboxService.py Removes unused imports Iterable and TM1pyRestException
TM1py/Services/RestService.py Fixes f-string formatting in warning message
TM1py/Services/ProcessService.py Reorganizes imports alphabetically and fixes formatting issues
TM1py/Services/LoggerService.py Fixes f-string formatting in URL assignments
TM1py/Services/HierarchyService.py Fixes f-string formatting in error message
TM1py/Services/ElementService.py Removes unused import and fixes f-string formatting
TM1py/Services/CellService.py Reorganizes imports alphabetically and fixes various formatting issues
TM1py/Objects/ChoreStartTime.py Replaces lambda with proper function definition
TM1py/Objects/Application.py Fixes f-string formatting in deprecation warning

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@onefloid onefloid force-pushed the chore-introduce-linter branch from 4cf4663 to b5ebec3 Compare September 14, 2025 21:22
@onefloid onefloid force-pushed the chore-introduce-linter branch from 9a2e395 to 26b4f6e Compare September 14, 2025 21:50
@onefloid onefloid marked this pull request as ready for review September 15, 2025 10:26
@MariusWirtz MariusWirtz merged commit 5bfd54d into master Oct 3, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2025

Tests completed for environment: tm1-11-cloud. Check artifacts for details.

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.

3 participants