Fix CodeQL parsing errors by excluding Jekyll template files from JavaScript analysis#17
Conversation
…errors Co-authored-by: sphildreth <193334+sphildreth@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR removes Jekyll YAML front matter from four JavaScript files to resolve CodeQL parsing errors. The YAML front matter (containing exclude_in_search, layout, and delimiter lines) was causing CodeQL's JavaScript parser to fail with "Assigning to rvalue" errors, as YAML is not valid JavaScript syntax.
Key Changes:
- Removed 4 lines of YAML front matter from each of the four affected JavaScript files
- Files now start directly with valid JavaScript code (IIFE patterns)
- CodeQL can now successfully parse the JavaScript structure
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| docs/assets/js/main.js | Removed YAML front matter; file now starts with JavaScript IIFE |
| docs/assets/js/search.js | Removed YAML front matter; file now starts with JavaScript IIFE |
| melodee/docs/assets/js/main.js | Removed YAML front matter; file now starts with JavaScript IIFE |
| melodee/docs/assets/js/search.js | Removed YAML front matter; file now starts with JavaScript IIFE |
Review Summary: The changes are straightforward and correct. The PR successfully addresses the CodeQL parsing issue by removing non-JavaScript content from the beginning of the files. No issues were found with the implementation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot Why are the codeql on this PR failing? |
…alysis Co-authored-by: sphildreth <193334+sphildreth@users.noreply.github.com>
The CodeQL checks were failing because removing the YAML front matter exposed Jekyll/Liquid template syntax ( I've fixed this by:
The failing files ( Fixed in commit 6496e4a. |
CodeQL JavaScript analysis was failing because four JavaScript files contained Jekyll YAML front matter, causing parse errors at line 1. After removing the YAML front matter, CodeQL still failed because these files are Jekyll templates containing Liquid template syntax (
{% %},{{ }}), which is not valid JavaScript.Changes
Removed YAML front matter (lines 1-4) from:
docs/assets/js/main.jsdocs/assets/js/search.jsmelodee/docs/assets/js/main.jsmelodee/docs/assets/js/search.jsCreated
.github/codeql/codeql-config.ymlto exclude Jekyll template files from CodeQL JavaScript analysisUpdated
.github/workflows/codeql.ymlto reference the CodeQL configuration fileSolution
The affected JavaScript files are Jekyll templates that are processed by Jekyll's Liquid templating engine at build time. They contain syntax like
{{ site.url }}and{% for v in site.version_params.search_versions %}which is not valid JavaScript. These files are now excluded from CodeQL's JavaScript analysis using thepaths-ignoredirective in the CodeQL configuration, which is the recommended approach for template files that shouldn't be analyzed as pure JavaScript.Original prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.