Skip to content

Conversation

@djmaxus
Copy link
Owner

@djmaxus djmaxus commented May 16, 2025

Add CITATION.cff and update init script for metadata

Introduces a CITATION.cff file to provide citation metadata for the project, adhering to the citation-file-format standard.

Enhances the init script to support customizable project title and author details, enabling dynamic updates to metadata files like LICENSE and CITATION.

Improves maintainability by refactoring file reading logic into a reusable function and adding support for resetting the citation file template.

Closes #162

@djmaxus djmaxus self-assigned this May 16, 2025
Copilot AI review requested due to automatic review settings May 16, 2025 23:24
@djmaxus djmaxus linked an issue May 16, 2025 that may be closed by this pull request
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a CITATION file to the repository and updates the initialization script to support dynamic metadata such as project title and author details.

  • Updated the init function to accept first name, last name, and project title.
  • Added new functions reset_cff and read_to_char to process metadata files.
  • Introduced CITATION.cff, CITATION.cff.template, and added a YAML schema mapping in VSCode settings.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test.m Modified test call to adapt to new init function parameters.
init.m Updated init function signature and internal logic; added reset_cff and read_to_char functions.
CITATION.cff.template Added template file for citation metadata.
CITATION.cff Added initial citation file with preset metadata.
.vscode/settings.json Added YAML schema configuration for CITATION.cff.
@djmaxus djmaxus force-pushed the 162-add-and-cff branch from a65bb5b to 96cd5d4 Compare May 16, 2025 23:27
@djmaxus djmaxus requested a review from Copilot May 16, 2025 23:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds citation support and enhances the init script to accept more metadata and reuse file‐reading logic

  • Introduces a CITATION.cff.template and generates CITATION.cff via a new reset_cff helper
  • Refactors file I/O into read_to_char and extends init to take first_name, last_name, and project_title
  • Updates VS Code settings to apply a YAML schema for CITATION.cff

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test.m Updated init invocation to split full name and include title
init.m Refactored signature, added read_to_char and reset_cff
CITATION.cff.template Added base template for citation metadata
CITATION.cff New generated citation file
.vscode/settings.json Registered YAML schema for the citation file
Comments suppressed due to low confidence (2)

init.m:142

  • [nitpick] The return variable read_char is easily confused with the char type; consider renaming it to something more descriptive like file_content or content.
function read_char = read_to_char(file_name) 

init.m:132

  • [nitpick] Deleting the template may prevent regenerating the citation file later; consider keeping CITATION.cff.template in place or backing it up instead of removing it.
delete_file('CITATION.cff.template'); 
@djmaxus djmaxus force-pushed the 162-add-and-cff branch 2 times, most recently from ef0f720 to 2d78ffd Compare May 16, 2025 23:35
@djmaxus djmaxus requested a review from Copilot May 16, 2025 23:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for generating a CITATION.cff file and extends the init script to accept first name, last name, and project title parameters, refactoring file I/O into reusable helpers.

  • Introduce CITATION.cff.template and generate CITATION.cff during initialization
  • Refactor reading logic into read_to_char and add reset_cff helper
  • Update test.m, VSCode settings, and .gitattributes for the new citation workflow

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test.m Update init call to new signature with first/last name and project title
init.m Extend function signature, add reset_cff, read_to_char, and refactor file operations
CITATION.cff.template Add template for citation metadata
CITATION.cff Add generated citation metadata file
.vscode/settings.json Add YAML schema mapping for CITATION.cff
.gitattributes Mark CITATION.cff as export-ignore
Comments suppressed due to low confidence (4)

init.m:142

  • [nitpick] The output variable read_char is ambiguous; consider renaming it to something like file_content to clarify its purpose.
function read_char = read_to_char(file_name) 

test.m:1

  • The test invocation was updated but there's no assertion for the new citation output; consider adding a test to verify CITATION.cff generation.
init(1984, 'George', 'Orwell', '1984', self_delete=false, reset_test=false); 

CITATION.cff:26

  • [nitpick] The keyword 'Github Actions' should be 'GitHub Actions' to match official branding.
 - Github Actions 

init.m:132

  • Deleting the template file prevents subsequent regenerations of CITATION.cff. Consider preserving or renaming the template instead.
delete_file('CITATION.cff.template'); 
@djmaxus djmaxus force-pushed the 162-add-and-cff branch from 2d78ffd to 15e19c1 Compare May 16, 2025 23:43
@djmaxus djmaxus requested a review from Copilot May 16, 2025 23:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for generating a CITATION.cff file and refactors initialization logic for customizable metadata.

  • Introduces CITATION.cff.template and auto-generates CITATION.cff in the init script
  • Refactors file‐reading into a reusable read_to_char helper and updates init parameters to accept first_name, last_name, and project_title
  • Updates test invocation, README formatting, editor settings, and export rules for the new citation file

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test.m Updated init call to use separate first/last name and project title
init.m Extended signature, refactored file I/O, added reset_cff and read_to_char
README.md Added blank line before Pages deployment section
CITATION.cff.template New citation-file-format template
CITATION.cff Example generated citation metadata
.vscode/settings.json Added YAML schema mapping for CITATION.cff
.gitattributes Marked CITATION.cff as export-ignore
.cspell.json Added author names and ORCID to custom dictionary
Comments suppressed due to low confidence (1)

test.m:1

  • Consider adding a test case to verify that CITATION.cff is created with the expected content after running init, covering the new citation-generation feature.
init(1984, 'George', 'Orwell', '1984', self_delete=false, reset_test=false); 
djmaxus added 2 commits May 17, 2025 00:46
Add CITATION.cff and update init script for metadata Introduces a CITATION.cff file to provide citation metadata for the project, adhering to the citation-file-format standard. Enhances the `init` script to support customizable project title and author details, enabling dynamic updates to metadata files like LICENSE and CITATION. Improves maintainability by refactoring file reading logic into a reusable function and adding support for resetting the citation file template.
@djmaxus djmaxus force-pushed the 162-add-and-cff branch from 15e19c1 to 7f8e65e Compare May 16, 2025 23:47
@djmaxus djmaxus requested a review from Copilot May 16, 2025 23:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for a CITATION.cff file and refactors the init script to bolster metadata customization and reuse.

  • Introduces CITATION.cff.template and generates CITATION.cff with reset_cff
  • Refactors file-reading logic into a new read_to_char helper
  • Updates init signature to accept separate first/last names and a project title

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test.m Updated init invocation to match new signature
init.m Refactored file I/O, added read_to_char and reset_cff
README.md Added blank line for formatting
CITATION.cff.template Added new citation file template
CITATION.cff Added generated citation metadata
.vscode/settings.json Registered YAML schema for CITATION.cff
.gitattributes Excluded CITATION.cff from exports
.cspell.json Added author-specific terms for spell checking
Comments suppressed due to low confidence (2)

init.m:130

  • reset_cff and its template-deletion behavior aren’t covered by existing tests. Add unit tests to verify CITATION.cff content and that the template file is properly removed.
function reset_cff(first_name,last_name,project_title) 

init.m:138

  • There’s no concatenation operator (+) before the continuation on the next line, causing a syntax error. Add a + at the start of the following line so the string fragments combine correctly.
+ " given-names: " + first_name + "\n"... 
@djmaxus djmaxus merged commit 72cb362 into main May 16, 2025
9 checks passed
@djmaxus djmaxus deleted the 162-add-and-cff branch May 16, 2025 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants