Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise TraitNotificationError on trailing comma in on_trait_change spec. #926

Merged
merged 9 commits into from
Mar 17, 2020

Conversation

midhun-pm
Copy link
Contributor

Fixes #406

Modifies the ListenerParser which parses the name for the on_trait_changedecorator to check for a trailing ,.
Raises a TraitNotificationError error if trailing comma is present in the trimmed string.

@codecov-io
Copy link

codecov-io commented Mar 6, 2020

Codecov Report

Merging #926 into master will increase coverage by 0.21%.
The diff coverage is 71.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #926      +/-   ##
==========================================
+ Coverage   72.90%   73.12%   +0.21%     
==========================================
  Files          51       51              
  Lines        6456     6460       +4     
  Branches     1301     1302       +1     
==========================================
+ Hits         4707     4724      +17     
+ Misses       1357     1341      -16     
- Partials      392      395       +3     
Impacted Files Coverage Δ
traits/editor_factories.py 79.59% <0.00%> (-4.79%) ⬇️
traits/trait_base.py 62.96% <ø> (-0.46%) ⬇️
traits/constants.py 100.00% <100.00%> (ø)
traits/trait_handlers.py 61.11% <100.00%> (+0.08%) ⬆️
traits/traits_listener.py 81.64% <100.00%> (+0.07%) ⬆️
traits/trait_types.py 71.07% <0.00%> (-0.16%) ⬇️
traits/traits.py 76.92% <0.00%> (+4.04%) ⬆️
traits/etsconfig/etsconfig.py 63.46% <0.00%> (+6.41%) ⬆️

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 fbf08dc...0f60a1d. Read the comment docs.

Copy link
Contributor

@kitchoi kitchoi left a comment

Choose a reason for hiding this comment

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

I am sorry that #921 has just been merged. It added a test that will need to be changed as part of this PR as well.

traits/traits_listener.py Outdated Show resolved Hide resolved
Copy link
Member

@mdickinson mdickinson left a comment

Choose a reason for hiding this comment

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

Please could you address @kitchoi's comments?

@midhun-pm
Copy link
Contributor Author

Addressed PR comments. Sorry for the delay, lost track of this one.

Copy link
Contributor

@kitchoi kitchoi left a comment

Choose a reason for hiding this comment

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

LGTM!

traits/tests/test_extended_trait_change.py Outdated Show resolved Hide resolved
@mdickinson
Copy link
Member

The macOS Python 3.6 build seems flaky today. I've restarted it (again).

@kitchoi kitchoi requested a review from mdickinson March 16, 2020 15:26
@mdickinson
Copy link
Member

Ah, sorry; forgot that my own previous review would block merging.

Copy link
Member

@mdickinson mdickinson left a comment

Choose a reason for hiding this comment

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

LGTM

@mdickinson mdickinson merged commit fc08394 into master Mar 17, 2020
@mdickinson mdickinson deleted the bugfix/on_trait_change_spec_trailing_comma branch March 17, 2020 08:26
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.

on_trait_change: trailing comma in an extended name causes surprises
5 participants