Skip to content

Field Presence Consistency Check Result: Refine output #13013

@koppor

Description

@koppor

When --consistency-check is executed on https://github.com/JabRef/jabref/blob/main/jablib/src/test/resources/testbib/Chocolate.bib, the result is as follows:

Field Presence Consistency Check Result

| entry type | citation key | Eprint | Groups | Number | Pages | Readstatus | URL |
| ---------- | ------------ | ------ | ------ | ------ | ----- | ---------- | --- |
| Article    | Garcia_2018  | -      | -      | o      | -     | -          | -   |
| Article    | Ding_2006    | -      | -      | o      | -     | -          | -   |
| Article    | Richard_2017 | -      | ?      | -      | -     | ?          | -   |
| Article    | Corti_2009   | -      | -      | o      | o     | -          | -   |
| Article    | Cooper_2007  | -      | -      | o      | o     | -          | -   |
| Article    | Tokede_2011  | -      | -      | o      | o     | -          | -   |
| Article    | Keen_2001    | -      | -      | o      | o     | -          | -   |
| Article    | Katz_2011    | -      | -      | o      | o     | ?          | -   |
| Article    | Hooper_2012  | -      | -      | o      | o     | ?          | -   |
| Article    | Tan_2021     | -      | -      | o      | o     | ?          | -   |
| Article    | Fulton_1969  | o      | -      | o      | o     | -          | o   |
| Article    | Parker_2006  | -      | ?      | o      | o     | ?          | -   |
| Article    | Macht_2007   | -      | ?      | o      | o     | ?          | -   |
| Article    | Scholey_2013 | -      | ?      | o      | o     | ?          | -   |
| Article    | Di_Renzo_2012 | -      | ?      | o      | o     | ?          | -   |

x | required field is present
o | optional field is present
? | unknown field is present
- | field is absent
Consistency check completed

To have it rendered as markdown, it should be

Field Presence Consistency Check Result

| entry type | citation key  | Eprint | Groups | Number | Pages | Readstatus | URL |
| ---------- | ------------- | ------ | ------ | ------ | ----- | ---------- | --- |
| Article    | Cooper_2007   | -      | -      | o      | o     | -          | -   |
| Article    | Corti_2009    | -      | -      | o      | o     | -          | -   |
| Article    | Di_Renzo_2012  | -      | ?      | o      | o     | ?          | -   |
| Article    | Ding_2006     | -      | -      | o      | -     | -          | -   |
| Article    | Fulton_1969   | o      | -      | o      | o     | -          | o   |
| Article    | Garcia_2018   | -      | -      | o      | -     | -          | -   |
| Article    | Hooper_2012   | -      | -      | o      | o     | ?          | -   |
| Article    | Katz_2011     | -      | -      | o      | o     | ?          | -   |
| Article    | Keen_2001     | -      | -      | o      | o     | -          | -   |
| Article    | Macht_2007    | -      | ?      | o      | o     | ?          | -   |
| Article    | Parker_2006   | -      | ?      | o      | o     | ?          | -   |
| Article    | Richard_2017  | -      | ?      | -      | -     | ?          | -   |
| Article    | Scholey_2013  | -      | ?      | o      | o     | ?          | -   |
| Article    | Tan_2021      | -      | -      | o      | o     | ?          | -   |
| Article    | Tokede_2011   | -      | -      | o      | o     | -          | -   |

| Symbol | Meaning                   |
|--------|---------------------------|
| x      | required field is present |
| o      | optional field is present |
| ?      | unknown field is present  |
| -      | field is absent           |

Consistency check completed

  1. Adapt org.jabref.logic.quality.consistency.BibliographyConsistencyCheckResultTxtWriter#writeFindings / org.jabref.logic.quality.consistency.BibliographyConsistencyCheckResultTxtWriter#initializeColumnWidths to use the max of column headings text and column content as width
  2. Sort citatoin key output by label (first ordering still is entry type)
  3. Adapt org.jabref.logic.quality.consistency.BibliographyConsistencyCheckResultTxtWriter#writeFinding at the end to output markdown table - instead of just |. Also add another newline at the end

Result

Field Presence Consistency Check Result

entry type citation key Eprint Groups Number Pages Readstatus URL
Article Cooper_2007 - - o o - -
Article Corti_2009 - - o o - -
Article Di_Renzo_2012 - ? o o ? -
Article Ding_2006 - - o - - -
Article Fulton_1969 o - o o - o
Article Garcia_2018 - - o - - -
Article Hooper_2012 - - o o ? -
Article Katz_2011 - - o o ? -
Article Keen_2001 - - o o - -
Article Macht_2007 - ? o o ? -
Article Parker_2006 - ? o o ? -
Article Richard_2017 - ? - - ? -
Article Scholey_2013 - ? o o ? -
Article Tan_2021 - - o o ? -
Article Tokede_2011 - - o o - -
Symbol Meaning
x required field is present
o optional field is present
? unknown field is present
- field is absent

Consistency check completed

Metadata

Metadata

Assignees

Labels

good first issueAn issue intended for project-newcomers. Varies in difficulty.📌 Pinned📍 AssignedAssigned by assign-issue-action (or manually assigned)

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions