-
Notifications
You must be signed in to change notification settings - Fork 15
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
chore: set up husky & lint-staged AB#32125 #1854
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a50a677
chore: set up husky & lint-staged AB#32125
jannisvisser da86d15
chore: small corrections
jannisvisser 191c4df
chore: do not lint on js
jannisvisser ea7986c
chore: automatic fixes IBF-dashboard
jannisvisser f52fdb8
fix: move API-service lint-staged in rc file
jannisvisser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# git hook to run a command before actually committing when running `git commit`: | ||
# | ||
|
||
ORANGE='\033[0;33m' | ||
NC='\033[0m' # No Color | ||
|
||
log() { | ||
printf "${ORANGE}[pre-commit]${NC} $1\n" | ||
} | ||
|
||
log "Running custom pre-commit hook defined in ./husky/pre-commit" | ||
|
||
# Prevent committing to "main"-branch: | ||
if [ "$(git rev-parse --abbrev-ref HEAD)" = "main" ]; then | ||
log "You shouldn't commit directly to the main branch." | ||
log "Create a feature branch: git branch new-branch-name" | ||
log "Then reset 'main': git reset --hard origin/main" | ||
log "And continue to work: git checkout new-branch-name" | ||
exit 1 | ||
fi | ||
|
||
log "Running lint-staged" | ||
npx lint-staged | ||
|
||
log "All done" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
'*.{md,json,yml,scss}': 'prettier --write', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const baseConfig = require('../../.lintstagedrc.js'); | ||
|
||
module.exports = { | ||
...baseConfig, | ||
'*.{ts,js,html}': ['eslint --fix'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 16 additions & 16 deletions
32
interfaces/IBF-dashboard/src/app/analytics/analytics.enum.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
export enum AnalyticsPage { | ||
login = 'login', | ||
dashboard = 'dashboard', | ||
activationLog = 'activation-Log', | ||
dashboard = 'dashboard', | ||
login = 'login', | ||
} | ||
|
||
export enum AnalyticsEvent { | ||
watchIbfGuide = 'watch-ibf-guide', | ||
aboutTrigger = 'about-trigger', | ||
aggregateInformation = 'aggregate-information', | ||
adminLevel = 'admin-level', | ||
mapLayer = 'map-layer', | ||
mapLayerInformation = 'map-layer-information', | ||
exportView = 'export-view', | ||
logOut = 'log-out', | ||
aggregateInformation = 'aggregate-information', | ||
communityNotification = 'community-notification', | ||
damSite = 'dam', | ||
eapAction = 'eap-action', | ||
eapSubmit = 'eap-submit', | ||
waterPoint = 'water-point', | ||
redCrossBranch = 'red-cross-branch', | ||
evacuationCenter = 'evacuation-center', | ||
exportView = 'export-view', | ||
glofasStation = 'glofas-station', | ||
healthSite = 'health-site', | ||
damSite = 'dam', | ||
leadTime = 'lead-time', | ||
logOut = 'log-out', | ||
mapLayer = 'map-layer', | ||
mapLayerInformation = 'map-layer-information', | ||
mapMarker = 'map-marker', | ||
glofasStation = 'glofas-station', | ||
typhoonTrack = 'typhoon-track', | ||
mapPlaceSelect = 'map-place-select', | ||
leadTime = 'lead-time', | ||
redCrossBranch = 'red-cross-branch', | ||
stopTrigger = 'stop-trigger', | ||
evacuationCenter = 'evacuation-center', | ||
communityNotification = 'community-notification', | ||
typhoonTrack = 'typhoon-track', | ||
watchIbfGuide = 'watch-ibf-guide', | ||
waterPoint = 'water-point', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
interfaces/IBF-dashboard/src/app/analytics/severity-level.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ashboard/src/app/components/action-result-popover/action-result-popover.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...IBF-dashboard/src/app/components/activation-log-button/activation-log-button.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 15 additions & 12 deletions
27
...F-dashboard/src/app/components/areas-of-focus-summary/areas-of-focus-summary.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jannisvisser @arsforza This will not work because IBF does not have a
main
branch. It does have amaster
branch which we could use. Or create amain
branch and use that instead ofmaster
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point I'll correct it