You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Need a better way to skip when XML parse fails #608
This is pretty arcane & unreadable IMO -- hard to know without being pretty experienced with lintr internals what's going on here. And with lints, it's tough to just wrap that into a helper function because now that's something we need to export for downstreams to use as well I think.
Both checks are needed because
We want to skip on the last expression (where full_parsed_content is present) and
We can't use !is.null(source_file$parsed_content) because there are cases where parsed_content is present (e.g. in some parsing error situations, as fixed in Allow invalid xml #560) but xml_parsed_content is not. lastly
We can't skip based on xml_parsed_content because that element has the same name for the full file & individual expressions.
I think the easiest solution is to rename xml_parsed_content to full_xml_parsed_content to be consistent with parsed_content ➡️ full_parsed_content. There is some (?) breakage potential here in the event that some downstream logic depends on xml_parsed_content being the name for the full file, but I think it's worth the change for consistency & readability.
Activity
AshesITR commentedon Nov 28, 2020
Found one usage in all of CRAN for this.
Can we check if {goodpractice} would break on this change?
I suspect it won't.
https://github.com/cran/goodpractice/blob/1755c716e56043d7c471eea6ca56c639cf6ec38c/R/my_linters.R
Full search