Run flake8 directly instead of pytest-flake8#316
Conversation
|
Warning Review limit reached
More reviews will be available in 57 minutes and 57 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds Kotlin DSL ( ChangesGradle Kotlin DSL and License Plugin Injection
Dev Tooling: flake8 and tox cleanup
Sequence Diagram(s)sequenceDiagram
participant Scanner as find_package_manager
participant PackageManager as run_gradle_task
participant Injector as add_gradle_plugin_in_gradle
participant WrapperParser as get_gradle_version_from_wrapper
participant Parser as parse_oss_information
Scanner->>Scanner: detect build.gradle / build.gradle.kts
Scanner->>PackageManager: run with detected build file
PackageManager->>Injector: inject plugin into gradle_file
Injector->>WrapperParser: read gradle-wrapper.properties
WrapperParser-->>Injector: Gradle version tuple
Injector->>Injector: select plugin version, build DSL-specific config
Injector-->>PackageManager: plugin_injected=True
PackageManager->>PackageManager: run generateLicenseReport or generateLicenseTxt
PackageManager->>Parser: dependency-license.json path
Parser->>Parser: branch on list vs dict schema, normalize licenses
Parser-->>PackageManager: OssItem list
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/fosslight_dependency/_package_manager.py`:
- Around line 154-186: The subprocess.run calls for Gradle plugin execution lack
timeout parameters, which can cause dependency scanning to hang indefinitely if
Gradle dependency resolution stalls. Add a timeout parameter to both
subprocess.run calls: the first one in the const.ANDROID conditional block
running generateLicenseTxt command and the second one in the const.GRADLE
conditional block running generateLicenseReport command. This ensures that if
the Gradle process takes too long, it will be terminated rather than blocking
indefinitely.
- Around line 386-412: When an existing plugins block is found, imports are
prepended at line 387 before all data. However, when creating a new plugins
block in the else clause (around line 410-412), the new block is prepended
before data without accounting for the imports that were already added at line
387, causing inconsistent ordering where the new plugins block appears before
imports instead of after. To fix this, modify the line that prepends the new
plugins block so that imports remain at the top of the file. Instead of
prepending the new_plugins_block directly to data (which includes the imports),
insert the new block after the imports portion by reconstructing the data string
to maintain the order: imports first, then the new plugins block, then the
remaining data.
In `@src/fosslight_dependency/package_manager/Gradle.py`:
- Around line 55-56: The code currently reads moduleUrl (singular) from the
dictionary, but the new fixture schema provides moduleUrls (plural array).
Update the dictionary key lookup from moduleUrl to moduleUrls when retrieving
the module URL value on line 55. This change will ensure that homepage metadata
is correctly read from the new schema format and prevent the fallback to Maven
URL in the subsequent logic at lines 130-133, allowing the proper homepage URL
to be used when available.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 175d281f-2169-44f4-b041-98d0ee1b7ebf
📒 Files selected for processing (12)
requirements-dev.txtsrc/fosslight_dependency/_package_manager.pysrc/fosslight_dependency/constant.pysrc/fosslight_dependency/package_manager/Gradle.pysrc/fosslight_dependency/run_dependency_scanner.pytests/test_gradle/jib/build/reports/license/dependency-license.htmltests/test_gradle/jib/build/reports/license/dependency-license.jsontests/test_gradle/jib/build/reports/license/dependency-license.xmltests/test_gradle/jib/build/reports/license/license-dependency.htmltests/test_gradle/jib/build/reports/license/license-dependency.jsontests/test_gradle/jib/build/reports/license/license-dependency.xmltox.ini
💤 Files with no reviewable changes (6)
- tests/test_gradle/jib/build/reports/license/license-dependency.xml
- tests/test_gradle/jib/build/reports/license/dependency-license.xml
- tests/test_gradle/jib/build/reports/license/license-dependency.html
- tests/test_gradle/jib/build/reports/license/dependency-license.html
- tests/test_gradle/jib/build/reports/license/license-dependency.json
- requirements-dev.txt
Signed-off-by: woocheol <jayden6659@gmail.com>
Description
Run flake8 directly instead of pytest-flake8
Summary by CodeRabbit
New Features
build.gradle.kts) alongside Groovy (build.gradle).Improvements
Chores
toxflake8 execution.