23.01.2020, 12:11 | #1 |
Участник
|
waldo: AppSourceCop & mandatoryAffixes
Источник: https://dynamicsuser.net/nav/b/waldo...ndatoryaffixes
============== I recentlyblogged about how to rename files with myVSCode Extension to comply with the newfilename conventions from Microsoft. Somewhat related to that, we need to talk about … Pre-or Suffixing It’sbeen known for a while: pre-or suffixing is necessary to “live in thecloud”. It prevents duplicate namesin various places: duplicate table names, duplicate field names .. things likethat. It is actually very well describedon Microsoft Docs here: https://docs.microsoft.com/en-us/dyn...-prefix-suffix. In short:you need to pre-or suffix, especially for apps on AppSource, but actually onanything you do! AppSourceCop can help (let’s say“force”) you You areprobably familiar with : the codecopwith code analysis rules that are specifically for AppSource. Well .. when you enable this, it can helpyou. And in the next release: it willforce you to remember to set an affix (which means: a suffix or a prefix). You cansimply enable the AppSourceCop by: In termsof “affixes”, the AppSourceCop needs to know which you use. If you don’t do that – in the next release(v16) – the analyzer will tell you that you HAVE to tell him: Whatyou need to do From thedocumentation, it’s quite clear what you need to do:
Done? Well,you’re not done yet. All you’ve donenow, is told the AppSourceCop on which affixes it needs to check the objectsand controls. That way, it can“remind” you that you need to pay attention to it, like here: Obviously,it’s your job now to take this intoaccount, and haven decent names for your objects, fields, .. . Wait .. it’s not going to provide that affix for me?? No! But don’t worry – that’s where I come in;-). You might be familiar with my“CRS AL Language Extension” in VSCode that can handle renames offiles. Well, during the rename, it canprovide a prefix or suffix. So bysimply setting some extra settings for my extension (and yes – by providing thesuffix again), you’ll be able to get this going for you in an automated way: In short,this setting will automatically provide the WLD-suffix where it needs to whenyou save a file. Thereis a disconnect though … TheAppSourceCop allows multiple affixes .. and my CRS AL Language Extension doesnot. So whenever you intend to usemultiple affixes, I’m afraid you’ll have to disable the automatic rename by myextension, because it will only apply one. Simply remove the settings about the suffix, and provide it manually(AppSourceCop will remind you where ;-)). Even more– if you enable the CodeCop in the next release, you’ll even have another ruleto worry about: file name conventions. So, if you enable codecop: This issomething you could get in v16: Iactually alreadyblogged about that very recently, so I’m not going to repeat that. BUT – this coderule is also going to assumethan when you used this “MandatoryAffixes” (which you have to in thenext release), that you DON’T use the affix in the filename (read the errorabove carefully, and you’ll notice it doesn’t want my affix in it). Well, Ihad foreseen this setting for it: But thatalso is only useful for only one suffix or prefix at this moment. In short– auto renaming can become a challenge … :-/ … and that sucks… Staytuned… Headachesthat I intend to solve for you in the near future. This is what I intend to do in short term:
Источник: https://dynamicsuser.net/nav/b/waldo...ndatoryaffixes
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
Опции темы | Поиск в этой теме |
Опции просмотра | |
|