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

Feature/ec547 sobriety disabled dark mode #36

Conversation

raymondsoft
Copy link
Contributor

@raymondsoft raymondsoft commented Oct 7, 2024

This PR represents a significant update introducing a new module for analyzing pbxproj files, alongside a series of structural reorganizations aimed at making the codebase more modular and maintainable. The primary goal is to enable in-depth analysis of iOS project configuration files, identifying suboptimal practices, especially those affecting user interface management and energy consumption.

Key changes:

  • Addition of pbxproj-lang Module:

    • A new module has been created to analyze pbxproj files specific to iOS projects. This module contains rules, the parser, the Sensor, and other essential elements for the static analysis of iOS project configurations.
    • This module is designed to work similarly to swift-lang, using analogous structures and patterns, facilitating future extensibility and the integration of new rules specific to pbxproj files.
  • Refactoring and Relocation of Common Classes:

    • The CustomTreeVisitor, ParseTreeAnalyzer, and ParseTreeItemVisitor classes have been moved to the shared io.ecocode.ios module. These classes are now used by multiple modules (swift-lang and pbxproj-lang), ensuring better modularity and code reusability.
    • The common module has been enhanced to support shared functionality between Swift and pbxproj analyses, reducing code duplication.
  • Implementation of the DisabledDarkModeCheck Rule:

    • A new rule has been implemented to detect cases where the app interface is forced into light mode via the UIUserInterfaceStyle key in pbxproj files.
    • This rule encourages the use of automatic dark mode to improve energy efficiency, especially on devices with OLED displays. The rule recommends either removing the UIUserInterfaceStyle key or setting it to Automatic.
    • The rule's description has been carefully crafted in HTML, with a direct link to Apple's official documentation to provide developers with more context.

Copy link

sonarqubecloud bot commented Oct 7, 2024

Copy link
Contributor

@zippy1978 zippy1978 left a comment

Choose a reason for hiding this comment

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

Good job !
pbxproj support will allow addition of new checks easily !

@zippy1978 zippy1978 merged commit 4bd893f into green-code-initiative:main Oct 24, 2024
2 checks passed
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.

2 participants