Skip to content

Commit

Permalink
fix #20
Browse files Browse the repository at this point in the history
  • Loading branch information
hchiam committed Aug 4, 2019
1 parent b4ec120 commit 71f1dc5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to the "custom-vscode-linter" extension will be documented in this file.

## 0.7.1

- Fixed #20 faulty check for password for SQL.

## 0.7.0

- Added check for `TODO` comments.
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "custom-vscode-linter",
"displayName": "custom-vscode-linter",
"description": "Custom VSCode Linter!",
"version": "0.7.0",
"version": "0.7.1",
"publisher": "hchiam",
"repository": {
"type": "git",
Expand Down
4 changes: 3 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ export function activate(context: vscode.ExtensionContext) {
}

function check_encryptedSQL(rangesToDecorate: vscode.DecorationOptions[]) {
let regex = /AS[\r\n\s]+BEGIN/g;
// cover "AS BEGIN"
// cover "AS--WITH ENCRYPTION BEGIN" but missing "--comment: sp_password" after it
let regex = /(AS(?!--WITH ENCRYPTION)[\r\n\s]+BEGIN[\r\n\s]*|AS *--WITH ENCRYPTION[\r\n\s]+BEGIN(?![\r\n\s]*--comment: sp_password))/g;
let hoverMessage = 'AS BEGIN should have "AS--WITH ENCRYPTION" and "BEGIN -- comment: sp_password"';
let popupMessage = 'AS BEGIN should have "AS--WITH ENCRYPTION" and "BEGIN -- comment: sp_password"';
genericCheck(regex, hoverMessage, popupMessage, rangesToDecorate);
Expand Down
4 changes: 4 additions & 0 deletions visually-check-this.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ AS--WITH ENCRYPTION
BEGIN
--comment: sp_password // NO

AS--WITH ENCRYPTION
BEGIN
// YES

Number(someOkThing); // NO
Number(someID); // YES
Number(something.someId); // YES
Expand Down

0 comments on commit 71f1dc5

Please sign in to comment.