You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add two new rule callback functions to notify a user rule when NsiqCppStyle is about to start/end its session.
Technical Background
In NsiqCppStyle, a session is defined as the time range beginning just before the first source file is processed, and ending right after the last file is processed. Within this time range, NsiqCppStyle may have processed multiple projects (processing of a single file or an entire directory tree). There is always only one session for a given run of NsiqCppStyle.
Currently, NsiqCppStyle has two sets of callbacks to notify a user rule when processing events start and/or end:
for targetPath in targetPaths:
if targetPath is a file:
FileStartRule()
<process the file>
FileEndRule()
else:
# targetPath is a directory ("project")
for (each file in the directory tree):
FileStartRule()
<process the file>
FileEndRule()
ProjectRules()
In a recent user rule I wrote, I needed to "setup" and "teardown" global data at the start and end of the session: at session start I defined required data structures, while at session end I wrote out the accumulated information to an external JSON file.
The request is to define new rule callback functions to notify a user rule when the session starts and ends (e.g., SessionStartRule and SessionEndRule). When implemented, rule writers will have three types of time range notifications to work with:
SessionStartRule()
for targetPath in targetPaths:
if targetPath is a file:
FileStartRule()
<process the file>
FileEndRule()
else:
# targetPath is a directory ("project")
for (each file in the directory tree):
FileStartRule()
<process the file>
FileEndRule()
ProjectRules()
SessionEndRule()
(I have already implemented the above, and hope to create a pull request with the changes in the near future.)
The text was updated successfully, but these errors were encountered:
Requested Functionality
Add two new rule callback functions to notify a user rule when NsiqCppStyle is about to start/end its session.
Technical Background
In NsiqCppStyle, a
session
is defined as the time range beginning just before the first source file is processed, and ending right after the last file is processed. Within this time range, NsiqCppStyle may have processed multipleprojects
(processing of a single file or an entire directory tree). There is always only one session for a given run of NsiqCppStyle.Currently, NsiqCppStyle has two sets of callbacks to notify a user rule when processing events start and/or end:
In a recent user rule I wrote, I needed to "setup" and "teardown" global data at the start and end of the session: at session start I defined required data structures, while at session end I wrote out the accumulated information to an external JSON file.
The request is to define new rule callback functions to notify a user rule when the session starts and ends (e.g.,
SessionStartRule
andSessionEndRule
). When implemented, rule writers will have three types of time range notifications to work with:(I have already implemented the above, and hope to create a pull request with the changes in the near future.)
The text was updated successfully, but these errors were encountered: