Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2021-10

Masks: the naming of ...

15 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bart

Hi,

I thought I better start a new therad for this one, otherwise I get lost in the previous "TMask revisited" thread.

I would like to rename some stuff, now we still can.

Easier to remeber IMO:
WindowsQuirksAllAllowed -> AllWindowsQuirks
WindowsQuirksDefaultAllowed -> DefaultWindowsQuirks

MaskOpCodesAllAllowed -> AllMaskOpcodes
MaskOpCodesDefaultAllowed -> DefaultMaskOpcodes

property RangeAutoReverse -> AutoReverseRange

Internal consistency:

TMaskWindows -> TWindowsMask
TMaskListWindows -> TWindowsMaskList
(Because of the Matches* functions we already have)

Consitent coding style:
TMaskParsedCode enums: mpcXXX
TMaskFailCause enums: mfcXXX

Opinions please.

Bart

Reply by email

Maxim Ganetsky
to Bart

27.10.2021 18:50, Bart via lazarus пишет:

Show quoted text 27 lines
Hi, I thought I better start a new therad for this one, otherwise I get lost in the previous "TMask revisited" thread. I would like to rename some stuff, now we still can. Easier to remeber IMO: WindowsQuirksAllAllowed -> AllWindowsQuirks WindowsQuirksDefaultAllowed -> DefaultWindowsQuirks MaskOpCodesAllAllowed -> AllMaskOpcodes MaskOpCodesDefaultAllowed -> DefaultMaskOpcodes property RangeAutoReverse -> AutoReverseRange Internal consistency: TMaskWindows -> TWindowsMask TMaskListWindows -> TWindowsMaskList (Because of the Matches* functions we already have) Consitent coding style: TMaskParsedCode enums: mpcXXX TMaskFailCause enums: mfcXXX Opinions please.

Looks good to me.

Best regards, Maxim Ganetsky mailto:

Reply by email

Juha Manninen
to Bart

Bart, please run the TMask unit test project while you change the code. I fixed its compilation in 3c7586c0f8 but many tests fail. A unit test is especially useful with such text manipulation code. It is a good idea to run the tests after every change. Keep the test project open when changing.

Regards,
Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20211102/62bccdd2/attachment.html>

Reply by email

Bart
to Bart
PM Bart wrote
How to run that exactly without having to run the entire test suite?

OK, looked at the wrong test folder...

I fixed the filename 'a[b]c' not matching the mask 'a[b]c' in DisableRange.

TestSpecial: to test this feature mocAnyCharOrNone must be set, which is excluded from DefaultMaskOpCodes.

TestWindows: the tests for wqFilenameEnd I think only work if mocAnyCharOrNone is enabled: José commented that quirk with <Internally converted to "Anything[??].abc" >

This presents a problem, since DefaultMaskOpCodes excludes mocAnyCharOrNone , but DefaultWindowsQuirks requires it. I see 2 solutions:
1. On TWindows* mocAnyCharOrNone will be enabled by default, while it is not on TMask*
2. Remove wqFilenameEnd from DefaultWindowsQuirks and describe that adding that quirk implies that mocAnyCharOrNone will be enabled.

A cleaner solution would be to NOT have wqFilenameEnd depend on mocAnyCharOrNone , but I have no idea how to do that.

Bart

Reply by email

Bart
to Juha Manninen: Bart, please run the TMask unit test project while you change the code. I fixed its…
PM Juha Manninen wrote
Bart, please run the TMask unit test project while you change the code.

Whilst doing that I fiddled around with bot the tests and the masks unit. I then wanted to commit (push) these changes seperately. I got stuck.
In svn I could commit a single file, then another. I git I don;t know how to do that.

My workflow currently is:

make changes
git commit files I changed (solve one problem per commit) git pull (I have pull.rebase=true)
git push

I resorted to do a git restore on the changes to the test suite, then commiited and pushed the changes to masks unit.
(And then I found out my changes to the testsuit were unnecessary, so that saved me from doing the changes all over again...)

PS. The test suite runs fine again (but see my remarks on the wqFilenameEnd quirk.

PS 2: building any program in the lazarus tree pollutes my tree and git gives warnings about untracked files:
Here's what git tells me after building the test suite for masks unit: C:\devel\lazarus>git status
On branch main
Your branch is up to date with 'origin/main'.

Untracked files:
(use "git add <file>..." to include in what will be committed) components/lazutils/test/backup/
components/lazutils/test/testmasks.or

nothing added to commit but untracked files present (use "git add" to track)

Is there a way to suppress the warning about untracked files alltogether? Orr whould all this be added to our .gitignore file?

Bart

Reply by email

Juha Manninen
to Bart

I am away from my development computer now. Short comments about the git issues:

I use "git gui" for commits. It shows untracked files in a separate pane which does not bother much. IIRC there is a setting to not show can make many commits and push them sometime later. Actually you can modify, join and reorder them before pushing which is handy.

Regards
Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20211103/0384b7ba/attachment.html>

Reply by email

Bart
to Bart: OK, looked at the wrong test folder... I fixed the filename 'a[b]c' not matching the…
PM Bart wrote 8 lines
I see 2 solutions: 1. On TWindows* mocAnyCharOrNone will be enabled by default, while it is not on TMask* 2. Remove wqFilenameEnd from DefaultWindowsQuirks and describe that adding that quirk implies that mocAnyCharOrNone will be enabled. A cleaner solution would be to NOT have wqFilenameEnd depend on mocAnyCharOrNone , but I have no idea how to do that.

A third solution:
Include mocAnyCharOrNone in DefaultMaskOpCodes.
It is very unlikely that this will cause regressions, since in the old implementation [?] would only match a literal '?'.

Then, setting wqFilenameEnd in Quirks on TWindows* should implicitely acitvate mocAnyCharOrNone...

Bart

Reply by email

Unknown author
to Bart: On Tue, Nov 2, 2021 at 8:21 PM Juha Manninen via lazarus Whilst doing that I fiddled…
Bart wrote 9 lines
Untracked files: (use "git add <file>..." to include in what will be committed) components/lazutils/test/backup/ components/lazutils/test/testmasks.or nothing added to commit but untracked files present (use "git add" to track) Is there a way to suppress the warning about untracked files alltogether? Orr whould all this be added to our .gitignore file?

yes, put them in your .gitignore if you don't want them tracked and you want no notifications about them changing...

NOTE: No off-list assistance is given without prior approval. *Please keep mailing list traffic on the list where it belongs!*

Reply by email

Juha Manninen
to Bart: On Tue, Nov 2, 2021 at 8:21 PM Juha Manninen via lazarus Whilst doing that I fiddled…

On Wed, Nov 3, 2021 at 12:27 AM Bart via lazarus <

Show quoted text 8 lines
wrote: Whilst doing that I fiddled around with bot the tests and the masks unit. I then wanted to commit (push) these changes seperately. I got stuck. In svn I could commit a single file, then another. I git I don;t know how to do that.

A resolution by file for commits in arbitrary and limiting. Often changes for one feature or bug fix must spread to many files, and often changes made in one file should be split into many commits. "git gui" allows to include/exclude hunks and even single lines in/from a commit. I believe your GUI tool supports the same thing.

My workflow currently is:

Show quoted text 6 lines
make changes git commit files I changed (solve one problem per commit) git pull (I have pull.rebase=true) git push

Make many commits. Some of them may be experimental, no problem. Finally go through them, fix errors, join commits together, remove commits purely for debugging, and finally push.
If a feature gets longer to finish, keep it in a local branch and rebase to main sometimes.

PS. The test suite runs fine again (but see my remarks on the

wqFilenameEnd quirk.

Here it gives an error from procedure TestWindows. I don't see commits from you in the TestMasks project.

Regards,
Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20211103/6c454109/attachment.html>

Reply by email

Bart
to Juha Manninen
PM Juha Manninen wrote
Here it gives an error from procedure TestWindows.

Fixed now.
(Adjusted some tests, since DefaultMaskOpCodes changed, fixed the wqFileNameEnd error.)

I don't see commits from you in the TestMasks project.

Because as it turned out the changes I made to it were wrong, so I just reverted them.

Bart

Reply by email

Maxim Ganetsky
to Bart: On Tue, Nov 2, 2021 at 8:21 PM Juha Manninen via lazarus Whilst doing that I fiddled…

03.11.2021 1:24, Bart via lazarus пишет:

Untracked files: (use "git add <file>..." to include in what will be committed) components/lazutils/test/backup/ components/lazutils/test/testmasks.or

I changed lazutils test projects to make their output to `units` subdirectory (it is already included in .gitignore) and also added `backup` subdirectories to .gitignore. Please test.

Best regards, Maxim Ganetsky mailto:

Reply by email