Page MenuHomePhabricator

[Utils] Allow update_test_checks to scrub attribute annotations
ClosedPublic

Authored by jdoerfert on Oct 10 2019, 6:33 PM.

Details

Summary

Attribute annotations, e.g., #0, are not useful on their own. This
patch adds a flag to update_test_checks to scrub them.

Diff Detail

Event Timeline

jdoerfert created this revision.Oct 10 2019, 6:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 10 2019, 6:33 PM
Herald added a subscriber: bollu. · View Herald Transcript
jdoerfert updated this revision to Diff 227480.Nov 1 2019, 10:46 AM

Make the decision per test (in preperation of D69701)

lebedev.ri requested changes to this revision.Dec 6 2019, 6:05 AM

Now that i believe there's some testing infra for these utils, add/update tests for this?

This revision now requires changes to proceed.Dec 6 2019, 6:05 AM
jdoerfert updated this revision to Diff 235671.Mon, Dec 30, 7:49 PM

Add a regression test

Unit tests: unknown.

clang-tidy: unknown.

clang-format: unknown.

Build artifacts: diff.json, console-log.txt

lebedev.ri accepted this revision.Mon, Dec 30, 11:26 PM

This is opt-in so should be ok.

This revision is now accepted and ready to land.Mon, Dec 30, 11:26 PM
This revision was automatically updated to reflect the committed changes.

Could you also make this change to update_cc_test_checks.py?

This code could move to common and we add a generates_ir flag to common.parse_commandline_args(parser). If that flag is set, parse_commandline_args adds the --function-signature and --scrub-attributes command line option and performs the SCRUB_TRAILING_WHITESPACE_TEST_RE -> SCRUB_TRAILING_WHITESPACE_AND_ATTRIBUTES_RE subsitituion?
If it's in common there should be no need for a separate update_cc_test_checks test (however, it probably makes sense to wait until D71565 has landed to avoid regresssions).

Could you also make this change to update_cc_test_checks.py?

This code could move to common and we add a generates_ir flag to common.parse_commandline_args(parser). If that flag is set, parse_commandline_args adds the --function-signature and --scrub-attributes command line option and performs the SCRUB_TRAILING_WHITESPACE_TEST_RE -> SCRUB_TRAILING_WHITESPACE_AND_ATTRIBUTES_RE subsitituion?
If it's in common there should be no need for a separate update_cc_test_checks test (however, it probably makes sense to wait until D71565 has landed to avoid regresssions).

I'm in favor of this happening and I can put it on my list. Though, if you want me to do this it will take some time.