Skip to content

Implements a Warning when a :FOR identifier is also mentioned on the :NEEDS #187

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Lisias
Copy link

@Lisias Lisias commented Feb 8, 2025

It was (finally) realized that :NEEDS doesn't completely inhibits :FOR, as it creates an identifier in the tagList even when :NEEDS is not satisfied.

This leaded to confusion more than one time, being one of oldest I found this one, from 2015:

https://github.com/ferram4/Ferram-Aerospace-Research/blame/787a30bc9deab0bde87591f0cc973ec3b0dd2de9/GameData/FerramAerospaceResearch/FerramAerospaceResearch.cfg#L303

It's subtle, but this patch in special does not cause trouble because its :FOR would unconditionally create an entry on the tagList for an add'on's identifier that already exists due the directory name having the same name, so no harm is done.

But exactly by being subtle, some people didn't grasped this counter-intuitive behaviour - what can lead to undesired collateral effects on patches that aims to be applied to an specific before anyone else using :AFTER, but not before anyone using :BEFORE, a use case where using :FOR is tempting.

This pull requests add's a Warning when it detects a :NEEDS using the same name used on :FOR, and I expect it to help prevent some unintended borkage on the field.

@Lisias Lisias marked this pull request as draft February 8, 2025 19:25
@Lisias
Copy link
Author

Lisias commented Feb 8, 2025

Not every occurrence of :FOR[foo]:NEEDS[foo] is going to cause damage. I had an idea to prevent them from being flagged as problems, what would surely cause some friction.

I'm testing the solution, and will add a commit with it once it's proven to work.

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.

1 participant