Skip to content

Conversation

@mdevolde
Copy link
Collaborator

@mdevolde mdevolde commented Nov 23, 2025

feat (server): added new properties and improved documentation

Why the pull request was made

This pull request improves the LanguageTool class API by making it more consistent, well-documented, and user-friendly. The changes provide better encapsulation, clearer property access patterns, and comprehensive documentation following established conventions.

Summary of changes

  • Added new read-only properties :
    • url
    • is_remote
    • host
    • port
  • Standardisation of access to public properties through getters and setters :
    • config
    • mother_tongue
    • disabled_rules
    • enabled_rules
    • disabled_categories
    • enabled_categories
    • enabled_rules_only
    • preferred_variants
    • picky
    • language
    • proxies
    • language_tool_download_version
  • private attribute about spell checking categories from an instance attribute to a class constant
  • Accessing only private attributes in the class methods
  • Improved documentation in this class
  • Correction of coverage badge display in README.md

Screenshots (if appropriate):

Not applicable.

How has this been tested?

Applied local tests.

Resources

Not applicable.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (changes to documentation only)
  • Refactor / code style update (non-breaking change that improves code structure or readability)
  • Tests / CI improvement (adding or updating tests or CI configuration only)
  • Other (please describe):

Checklist

  • Followed the project's contributing guidelines.
  • Updated any relevant tests.
  • Updated any relevant documentation.
  • Added comments to your code where necessary.
  • Formatted your code, run the linters, checked types and tests.

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 refactors the LanguageTool class to improve encapsulation and API consistency by converting public attributes to private ones with property accessors. It also adds new read-only properties for server configuration (url, is_remote, host, port) and enhances documentation throughout. Additionally, _SPELL_CHECKING_CATEGORIES is converted from an instance attribute to a class constant, and the coverage badge URL in README.md is corrected to use an absolute path.

Key Changes

  • Added property accessors for previously public attributes (disabled_rules, enabled_rules, disabled_categories, enabled_categories, enabled_rules_only, preferred_variants, picky, config, language_tool_download_version)
  • Introduced four new read-only properties (url, is_remote, host, port) to expose server configuration details
  • Converted _spell_checking_categories from an instance attribute to a class constant _SPELL_CHECKING_CATEGORIES

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
language_tool_python/server.py Refactored attributes to use private naming with property accessors; added new read-only properties for server configuration; converted spell checking categories to class constant; improved documentation throughout
README.md Fixed coverage badge to use absolute GitHub URL instead of relative path for proper display
coverage-badge.svg Updated coverage percentage from 78.69% to 77.48%

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mdevolde mdevolde merged commit 89b7d58 into jxmorris12:master Nov 23, 2025
8 checks passed
@mdevolde mdevolde deleted the properties branch November 23, 2025 11:23
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