Skip to content

Raise ParseError on duplicate keys in configfile#3121

Merged
j9ac9k merged 2 commits intopyqtgraph:masterfrom
outofculture:we-were-duped
Aug 7, 2024
Merged

Raise ParseError on duplicate keys in configfile#3121
j9ac9k merged 2 commits intopyqtgraph:masterfrom
outofculture:we-were-duped

Conversation

@outofculture
Copy link
Copy Markdown
Contributor

Maybe we shouldn't really be maintaining our own config file format, but since we're doing so anyway, here's a behavior we should have.

This includes some minor style updates, as well, which my editor demanded I make before it would let me edit the code (I kid).

#print "Going deeper..", ln+1
(ln, val) = parseString(lines, start=ln+1, **scope)
if k in data:
raise ParseError(f'Duplicate key: {k}', ln+1, l)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here's the only substantive change.

@j9ac9k
Copy link
Copy Markdown
Member

j9ac9k commented Aug 7, 2024

"Thanks, I hate it" (not referring to your PR, but supporting our own config file 😆 )

@j9ac9k j9ac9k merged commit 442f08a into pyqtgraph:master Aug 7, 2024
j9ac9k pushed a commit to j9ac9k/pyqtgraph that referenced this pull request Mar 25, 2025
* raise ParseError when configfiles have duplicate keys

* style improvements while looking around
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants