Skip to content

Commit

Permalink
Update for julia 1.10 (lts) and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Azzaare committed Nov 2, 2024
1 parent 8f9dcc9 commit cb8aaf8
Show file tree
Hide file tree
Showing 14 changed files with 192 additions and 115 deletions.
1 change: 1 addition & 0 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style = "sciml"
19 changes: 16 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
name = "BibParser"
uuid = "13533e5b-e1c2-4e57-8cef-cac5e52f6474"
authors = ["azzaare <[email protected]>"]
version = "0.2.1"
version = "0.2.2"

[deps]
BibInternal = "2027ae74-3657-4b95-ae00-e2f7d55c3e64"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
JSONSchema = "7d188eb4-7ad8-530c-ae41-71a32a6d4692"
TestItems = "1c621080-faea-4a02-84b6-bbd5e436b8fe"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"

[compat]
BibInternal = "0.3"
BibInternal = "0.3.7"
DataStructures = "0.18"
Dates = "1"
JSONSchema = "1"
TestItems = "1"
YAML = "0.4"
julia = "1.6"
julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"

[targets]
test = ["Aqua", "ExplicitImports", "JET", "Test", "TestItemRunner"]
3 changes: 3 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[default.extend-words]
# Don't correct the surname "Teh"
annote = "annote"
4 changes: 2 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using Documenter, BibParser, BibInternal
makedocs(
sitename = "BibParser.jl",
authors = "Jean-François BAFFIER",
repo="https://github.com/Humans-of-Julia/BibParser.jl/blob/{commit}{path}#L{line}",
repo = "https://github.com/Humans-of-Julia/BibParser.jl/blob/{commit}{path}#L{line}",
format = Documenter.HTML(
prettyurls = get(ENV, "CI", nothing) == "true"
),
Expand All @@ -12,7 +12,7 @@ makedocs(
"BibTeX" => "bibtex.md",
# "BibTeX - automa" => "bibtex_automa.md",
"CSL-JSON" => "csl.md",
"Internal" => "internal.md",
"Internal" => "internal.md"
]
)

Expand Down
6 changes: 4 additions & 2 deletions src/BibParser.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module BibParser

import TestItems: @testitem

export parse_entry
export parse_file

Expand All @@ -25,15 +27,15 @@ For bibliography formats with formatting rules (such as `:BibTeX`), the `check`
parse_file(path, ::Val{:BibTeX}; check) = BibTeX.parse_file(path; check)
parse_file(path, ::Val{:CFF}; check) = CFF.parse_file(path)

parse_file(path, parser=:BibTeX; check=:error) = parse_file(path, Val(parser); check)
parse_file(path, parser = :BibTeX; check = :error) = parse_file(path, Val(parser); check)

"""
parse_entry(entry::String; parser::Symbol = :BibTeX)
Parse a string entry. Default to BibTeX format. No other options available yet (CSL-JSON coming soon).
For bibliography formats with formatting rules (such as `:BibTeX`), the `check` keyword argument can be set to `:none` (or `nothing`), `:warn`, or `:error`.
"""
function parse_entry(entry; parser=:BibTeX, check = :error)
function parse_entry(entry; parser = :BibTeX, check = :error)
return parser == :BibTeX && return BibTeX.parse_string(entry; check)
end

Expand Down
Loading

0 comments on commit cb8aaf8

Please sign in to comment.