Nagasaki45 / bibo

Command line reference manager with a single source of truth: the .bib file. Inspired by beets.
MIT License
32 stars 4 forks source link

Handling entry types with capitalised letters #72

Closed kaustubhmote closed 4 years ago

kaustubhmote commented 4 years ago

This PR fixes #70. Briefly, the comment and preamble types were previously recognised only if the @comment or @preamble was denoted by lowercase letters. This made bib files generated by other libraries that use capitalised letters (for example @Comment) incompatible with bibo. The comparison is now done with the variable type_ converted to lowercase.

This PR does not change the default behaviour of bibo.

codecov[bot] commented 4 years ago

Codecov Report

Merging #72 into dev will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev      #72   +/-   ##
=======================================
  Coverage   98.54%   98.54%           
=======================================
  Files          21       21           
  Lines        1168     1168           
=======================================
  Hits         1151     1151           
  Misses         17       17           
Impacted Files Coverage Δ
bibo/internals.py 93.83% <100.00%> (ø)
pybibs/_internals.py 100.00% <100.00%> (ø)
pybibs/pybibs.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 40ce657...d032e84. Read the comment docs.

Nagasaki45 commented 4 years ago

Thanks @kaustubhmote! What do you think about treating string types the same way? It seems to me that all checks on types should be case insensitive.

kaustubhmote commented 4 years ago

You are right, string type should also be checked. I pushed another commit in this branch to do this. I tried to look for other places in the code base where this may be required, but seems like this covers all the places where this is required. Let me know if there is someplace that I missed

Also, the base branch for this PR is now dev as well.

Nagasaki45 commented 4 years ago

Amazing! BTW, feel free to send a PR adding you to the contributors file :-)