Skip to content

Conversation

@sonalyadav1
Copy link
Contributor

Purpose / Description

Add lint rules to enforce layout file naming conventions (activity_, fragment_, view_, dialog_ prefixes) and fix existing violations.

Fixes

Approach

1)Created 4 custom lint detectors using ViewBinding class detection
2)Renamed non-compliant layout files and updated code references

How Has This Been Tested?

1)All lint-rules unit tests pass
2)Build successful (./gradlew assemblePlayDebug)
3)No remaining lint violations

Test config: macOS, JDK 21

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

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

Output looks fine from an initial glance, looks good to go once code is cleaned up.

Thanks!!

@BrayanDSO BrayanDSO added the Needs Author Reply Waiting for a reply from the original author label Jan 3, 2026
Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

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

Seems good, cheers! Needs a squash merge

This may need fixing once more classes are converted as part of the following issue, but I'll take responsibility for this.

@david-allison david-allison added Needs Second Approval Has one approval, one more approval to merge squash-merge A squash & force push is required. The PR author may do this to speed up the merge process. and removed Needs Author Reply Waiting for a reply from the original author labels Jan 4, 2026
@@ -0,0 +1,94 @@
/*
* Copyright (c) 2026 Sonal Yadav
Copy link
Member

@Haz3-jolt Haz3-jolt Jan 4, 2026

Choose a reason for hiding this comment

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

Nit: Use your mail as well
Eg:

 *  Copyright (c) 2025 Hari Srinivasan <[email protected]>

@sonalyadav1 sonalyadav1 force-pushed the lint/enforce-layout-naming-conventions branch from da36da5 to cd9e055 Compare January 5, 2026 06:36
@BrayanDSO BrayanDSO added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Second Approval Has one approval, one more approval to merge labels Jan 6, 2026
(activity_, fragment_, view_, dialog_)

Add email to copyright headers

Refactor layout prefix detectors: extract shared utils, use Kotlin tests

lint: enforce dialog_ prefix for Dialog layouts

lint: enforce view_ prefix for View layouts

lint: enforce fragment_ prefix for Fragment layouts

lint: enforce activity_ prefix for Activity layouts
@BrayanDSO BrayanDSO force-pushed the lint/enforce-layout-naming-conventions branch from cd9e055 to 4339e95 Compare January 6, 2026 10:02
@BrayanDSO BrayanDSO removed the squash-merge A squash & force push is required. The PR author may do this to speed up the merge process. label Jan 6, 2026
@BrayanDSO BrayanDSO enabled auto-merge January 6, 2026 10:03
@BrayanDSO BrayanDSO added this pull request to the merge queue Jan 6, 2026
Merged via the queue into ankidroid:main with commit 1512be9 Jan 6, 2026
14 of 15 checks passed
@github-actions github-actions bot removed the Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) label Jan 6, 2026
@github-actions github-actions bot added this to the 2.24 release milestone Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lint: enforce naming standards for some layouts

4 participants