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

Emit error if target appears twice #184

Closed
jayvdb opened this issue Jan 26, 2019 · 7 comments
Closed

Emit error if target appears twice #184

jayvdb opened this issue Jan 26, 2019 · 7 comments
Milestone

Comments

@jayvdb
Copy link
Member

jayvdb commented Jan 26, 2019

There are some future use-cases for a target appearing twice. e.g. #38 , and also splitting targets into multiple files , where it is more likely that two entries might occur.

We need to reject this occurring now, until we have decided how that scenario should be handled.

@chfw
Copy link
Member

chfw commented Jan 26, 2019

I think sequentially, 1) the latter one shall override the earlier ones or 2) throw an error.

The matching criteria: a. template name, b. config file name, c. output file name are the same. A new class named 'target' may benefit the matching process.

@jayvdb jayvdb added this to the 0.4.0 milestone Jan 26, 2019
@chfw
Copy link
Member

chfw commented Feb 17, 2019

I am just wondering if output alone is the sole error emitter, two or more targets produces: 'great.output'

@jayvdb
Copy link
Member Author

jayvdb commented Feb 18, 2019

This issue is about emitting an error now, because repeating a target now is not supported, especially if the target is repeated in targets and copy.

@jayvdb jayvdb pinned this issue Feb 18, 2019
@chfw
Copy link
Member

chfw commented Feb 18, 2019

to define 'repeat', would you agree that 'output' field is enough?

@chfw
Copy link
Member

chfw commented Feb 27, 2019

When I looked at in code, there is an exception guard this error already, https://github.com/moremoban/moban/blame/dev/moban/plugins/strategy.py#L44.

So I am closing it unless the exception does not raise when there are two duplicated targets.

here is the test case for such a scenario: https://github.com/moremoban/moban/blob/dev/tests/integration_tests/test_command_line_options.py#L327

@chfw chfw closed this as completed Feb 27, 2019
@chfw chfw unpinned this issue Feb 27, 2019
@jayvdb
Copy link
Member Author

jayvdb commented Feb 28, 2019

Where I encountered this was a copy: and a target: with the same filename.

Now we are deprecating copy:, bugs only caused by using copy: can be ignored imo.

@chfw
Copy link
Member

chfw commented Feb 28, 2019

Oh I see. That makes sense. I forgot that copy was separate to targets.

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

No branches or pull requests

2 participants