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

Markdown: 'Unexpected classifier: "#", expected either "Module" or "Package". ' error should include filename #4001

Open
kenyee opened this issue Jan 17, 2025 · 0 comments
Labels

Comments

@kenyee
Copy link

kenyee commented Jan 17, 2025

Describe the bug
When an error is detected, it should include the filename/path of the file as well as the full line of the error. Instead, the only error msg is:

Unexpected classifier: "#", expected either "Module" or "Package"

Expected behaviour
Error should include the filename that has the issue.

To Reproduce
Update the README.md file in a submodule so it has something like

# Compose UI components

instead of

# Module compose-ui-components

Dokka configuration

internal fun Project.configureDokka(versionCatalog: VersionCatalog) {
    with(pluginManager) {
        apply(versionCatalog.findPlugin("dokka").get().get().pluginId)
    }
    tasks.withType<AbstractDokkaTask>().configureEach {
        suppressObviousFunctions.set(true)
    }
    tasks.withType<DokkaTaskPartial>().configureEach {
        moduleName.set(project.path.removePrefix(":").replace(":", "/"))
        outputDirectory.set(layout.buildDirectory.dir("docs/partial"))
        dokkaSourceSets.configureEach {
            // Dokka runs against all SourceSets by default, so filter most of them out for speed
            dokkaSourceSets.filter {
                SUPPRESSED_SOURCE_SETS.contains(it.name)
            }.forEach {
                logger.info("Dokka: Suppressing ${it.name} SourceSet in project ${project.name}")
                it.suppress.set(true)
            }
            dokkaSourceSets.forEach {
                // Sadly, you can't give Dokka a wildcard...have to list each file here :-(
                // Each module can have a Samples.kt file though.
                it.samples.setFrom("$projectDir/src/main/java/samples/Samples.kt")
            }

            val readMeProvider = project.layout.projectDirectory.file("README.md")
            if (readMeProvider.asFile.exists()) {
                includes.from(readMeProvider)
            }

            if (name.contains("androidTest", ignoreCase = true)) {
                suppress.set(true)
            }
            skipDeprecated.set(true)

            // Skip internal packages
            perPackageOption {
                matchingRegex.set(".*\\.internal\\..*")
                suppress.set(true)
            }

            // Add source links
            sourceLink {
                localDirectory.set(layout.projectDirectory.dir("src").asFile)
                val relPath = rootProject.projectDir.toPath().relativize(projectDir.toPath())
                remoteUrl.set(URL("https://github.netflix.net/corp/and-samurai/tree/main/$relPath/src"))
                remoteLineSuffix.set("#L")
            }
        }
    }
}

Installation

  • Operating system: macOS 24.1.0
  • Build tool: Gradle 8.12
  • Dokka version: 2.0.0
@kenyee kenyee added the bug label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant