Skip to content
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

Fixed .js file handling during RunAll #46

Merged
merged 2 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.6] - 2024-07-29

### Fixed
-Fixed .js files in other namespaces' /itemsetsourcelink web app being editing during ##class(pkg.isc.codetidy.Utils).RunAll (#45)
-Fixed .js files being re-exported without edit during ##class(pkg.isc.codetidy.Utils).RunAll() even though ESLint is disabled so no reason to export (#44)

## [1.1.5] - 2023-02-23

### Fixed
Expand Down
46 changes: 24 additions & 22 deletions cls/pkg/isc/codetidy/Utils.cls
Original file line number Diff line number Diff line change
Expand Up @@ -159,30 +159,32 @@ ClassMethod RunAll(pOnlyIfInSourceControl As %Boolean = 1) As %Status

// Run all .js files
// Build the spec for StudioOpenDialog
set spec = ""
set codeNamespace = $namespace
set $namespace = "%SYS"
set result = ##class(%SQL.Statement).%ExecDirect(,"select * from Security.Applications where NameSpace = ?", codeNamespace)
while result.%Next() {
// Exclude anything from the itemsetsourcelink web application
if result.ID '= "/itemsetsourcelink" {
set entry = $extract(result.ID, 2, *)_"/*.js"
if spec = "" {
set spec = entry
} else {
set spec = spec_","_entry
if ..GetESLintEnabled() {
set spec = ""
set codeNamespace = $namespace
set $namespace = "%SYS"
set result = ##class(%SQL.Statement).%ExecDirect(,"select * from Security.Applications where NameSpace = ?", codeNamespace)
while result.%Next() {
// Exclude anything from the itemsetsourcelink web application
if $Extract(result.ID, 1, 18) '= "/itemsetsourcelink" {
set entry = $extract(result.ID, 2, *)_"/*.js"
if spec = "" {
set spec = entry
} else {
set spec = spec_","_entry
}
}
}
}
set $namespace = codeNamespace

// Run StudioOpenDialog to get the .js files
set resultSet = ##class(%Library.ResultSet).%New("%RoutineMgr:StudioOpenDialog")
$$$ThrowOnError(resultSet.Prepare())
$$$ThrowOnError(resultSet.Execute(spec, 1, 1, 0, 1, 0, 0, ""))
while resultSet.Next() {
set name = resultSet.Data("Name")
$$$ThrowOnError(##class(pkg.isc.codetidy.Utils).Run(name, pOnlyIfInSourceControl))
set $namespace = codeNamespace

// Run StudioOpenDialog to get the .js files
set resultSet = ##class(%Library.ResultSet).%New("%RoutineMgr:StudioOpenDialog")
$$$ThrowOnError(resultSet.Prepare())
$$$ThrowOnError(resultSet.Execute(spec, 1, 1, 0, 1, 0, 0, ""))
while resultSet.Next() {
set name = resultSet.Data("Name")
$$$ThrowOnError(##class(pkg.isc.codetidy.Utils).Run(name, pOnlyIfInSourceControl))
}
}
} catch e {
set sc = e.AsStatus()
Expand Down
2 changes: 1 addition & 1 deletion module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Export generator="IRIS" version="26">
<Document name="isc.codetidy.ZPM"><Module>
<Name>isc.codetidy</Name>
<Version>1.1.5</Version>
<Version>1.1.6</Version>
<Packaging>module</Packaging>
<Resource Name="pkg.isc.codetidy.PKG" Directory="cls" />
<Resource Name="pkg.isc.codetidy.CodeTidy.INC" Directory="inc" />
Expand Down
Loading