Skip to content

Commit

Permalink
Merge pull request #153 from LowlyDBA/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
lowlydba authored Oct 17, 2020
2 parents 1ff4bde + 0621732 commit a6b4d40
Show file tree
Hide file tree
Showing 24 changed files with 3,238 additions and 426 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# linguist overrides
*.sql linguist-language=TSQL
*.sql diff

# line endings for code coverage files
appveyor/sqlcover/* text eol=lf
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.markdownlint.json
node_modules/*
package-lock.json
debug.log
2 changes: 2 additions & 0 deletions appveyor/build_tsqlt_tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ param(
$Color = "Green"
)

$ErrorActionPreference = "Stop"

Write-Host "Building tSQLt Tests..." -ForegroundColor $Color

If ($IsAzureSQL) {
Expand Down
2 changes: 1 addition & 1 deletion appveyor/generate_combined_script.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ if (Test-Path $File) {
Remove-Item $File
}

Get-Item $Filter | Get-Content | Out-File $File
Get-Item $Filter | Get-Content | Out-File $File -Encoding utf8
10 changes: 7 additions & 3 deletions appveyor/install_dependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ Write-Host "Installing dependencies..." -ForegroundColor $Color

# TSQLLinter
# Try/Catch to stop appveyor unnecessary errors
Try { npm install tsqllint -g | Out-Null }
Catch { }
$result = npm list -g --depth=0
If (-Not ($result -Match "tsqllint")) {
npm install tsqllint -g | Out-Null
}

# SQLServer Module
if (!(Get-Module -ListAvailable -Name SqlServer)) {
Install-Module SqlServer -Force -AllowClobber
}

# DbaTools Module
Install-Module DbaTools -Force -AllowClobber
if (!(Get-Module -ListAvailable -Name DbaTools)) {
Install-Module DbaTools -Force -AllowClobber
}
2 changes: 2 additions & 0 deletions appveyor/run_tsqllint.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ param(
$Color = "Green"
)

$ErrorActionPreference = "Stop"

Write-Host "Running TSQLLint with config $Config..." -ForegroundColor $Color
tsqllint -c $Config *.sql
945 changes: 579 additions & 366 deletions appveyor/sqlcover/Coverage.opencoverxml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion appveyor/sqlcover/Run_SQLCover.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ If ($IsCoverStarted) {
$tmpFile = Join-Path $env:TEMP "Coverage.html"
Set-Content -Path $tmpFile -Value $coverageResults.Html2() -Force
Invoke-Item $tmpFile
Start-Sleep -Seconds 1
Start-Sleep -Seconds 3
Remove-Item $tmpFile
}
}
Expand Down
6 changes: 6 additions & 0 deletions appveyor/sqlcover/[dbo].[sp_doc]
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CREATE PROCEDURE [dbo].[sp_doc]
,@ExtendedPropertyName SYSNAME = 'Description'
,@LimitStoredProcLength BIT = 1
,@Emojis BIT = 0
,@Verbose BIT = 1
/* Parameters defined here for testing only */
,@SqlMajorVersion TINYINT = 0
,@SqlMinorVersion SMALLINT = 0
Expand Down Expand Up @@ -78,6 +79,11 @@ BEGIN
IF (@DatabaseName IS NULL)
BEGIN
SET @DatabaseName = DB_NAME();
IF (@Verbose = 1)
BEGIN;
SET @Msg = 'No database provided, assuming current database.';
RAISERROR(@Msg, 10, 1) WITH NOWAIT;
END;
END
ELSE IF (DB_ID(@DatabaseName) IS NULL)
BEGIN;
Expand Down
Loading

0 comments on commit a6b4d40

Please sign in to comment.