npm install --global --production windows-build-tools --vs2015
Tell Node to use the 2015 build tools.
npm config set msvs_version 2015 –global
Set your Node config to use Python 2.7.
npm config set python python2.7
npm install –no-optional
npm install --global --production windows-build-tools --vs2015
npm config set msvs_version 2015 –global
npm config set python python2.7
npm install –no-optional
https://github.com/JanDeDobbeleer/oh-my-posh
You need to use the PowerShell Gallery to install oh-my-posh.
Install posh-git and oh-my-posh:
Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
Enable the prompt:
# Start the default settings
Set-Prompt
# Alternatively set the desired theme:
Set-Theme Agnoster
Prerequisite:
docker-compose.yml
.docker-compose.yml
.
version: "3.1"
services:
localstack:
image: localstack/localstack:latest
container_name: localstack_demo
ports:
- "4563-4599:4563-4599"
- "8000:8080"
environment:
- SERVICES=${SERVICES- }
- DEBUG=1
- DATA_DIR=/tmp/localstack/data
volumes:
- "./.localstack:/tmp/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
docker-compose.yml
is kept.docker-compose up
command.Are you getting less space on the PowerShell due to the long path of the current directory?
You can increase the signal to noise ratio by hiding that long path. How?
$profile
.function prompt {
$p = Split-Path -leaf -path (Get-Location)
"$p> "
}
In this post, I will note down steps to collect human-readable code coverage for .net core/standard apps on the developer machine.
I have created a simple .NET standard class library and .net core test project (xUnit) project here.
You will require the following NuGet packages to be installed on the xUnit tests project (BeingCraftsman.CoverageDemo.Tests).
dotnet add package coverlet.msbuild
dotnet new tool-manifest
dotnet tool install dotnet-reportgenerator-globaltool
dotnet test
is running all tests.dotnet test /p:CollectCoverage=true /p:CoverletOutput="./CodeCoverage/" /p:CoverletOutputFormat="opencover"
dotnet reportgenerator "-reports:.\CodeCoverage/coverage.opencover.xml" "-targetdir:.\CodeCoverage\Web"
start .\CodeCoverage\Web\index.htm
Getting tired of running all these commands one by one.
Next time, onwards, just combine them with “;” separated and execute.
dotnet test /p:CollectCoverage=true /p:CoverletOutput="./CodeCoverage/" /p:CoverletOutputFormat="opencover"; dotnet reportgenerator "-reports:.\CodeCoverage/coverage.opencover.xml" "-targetdir:.\CodeCoverage\Web"; start .\CodeCoverage\Web\index.htm
The dotnet test
command is used to execute unit tests in a given solution. The dotnet test
command builds the solution and runs a test host application for each test project in the solution.
More details: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test
Coverlet is Cross platform code coverage for .NET. How it works.
Coverlet also integrates with the build system to run code coverage after tests. In our case, MSBuild is the build system and hence we are using this package. For other build systems, you would require another package.
More details: https://github.com/coverlet-coverage/coverlet
ReportGenerator converts coverage reports generated by OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov into human readable reports in various formats.
More details: https://github.com/danielpalme/ReportGenerator
Are you a part of champion C# team who has developers from Different background (JavaScript, Python, Java, Ruby etc.)?
Some of them may prefer their own ways of indentations, placing curly brace locations (JavaScriptish), even not putting them at all (Python-ish).
Members from your team have different perspectives over C# coding styles however your team want everyone to follow agreed guideline as if code is written by a single developer and it’s readable?
remove unused variables, remove unused methods, remove unused namespaces and MANY MORE.
You can even push yourself and set few rules as errors in the .editorconfigs
Do you want to try it before applying it to your project?
Here is the git repo link:
https://github.com/way2datta/.net-practices/tree/master/Linters
Programs that send messages to other machines (or to other programs on the same machine) should conform completely to the specifications, but programs that receive messages should accept non-conformant input as long as the meaning is clear.
In programming, the rule of least power is a design principle that “suggests choosing the least powerful [computer] language suitable for a given purpose”.
The principle of least astonishment (POLA), also called the principle of least surprise (alternatively a “law” or “rule”)
applies to user interface and software design.
“If a necessary feature has a high astonishment factor, it may be necessary to redesign the feature.”
When two elements of an interface conflict, or are ambiguous, the behavior should be that which will least surprise the user; in particular a programmer should try to think of the behavior that will least surprise someone who uses the program.
The Pareto principle (also known as the 80/20 rule, the law of the vital few, or the principle of factor sparsity).
It states that, for many events, roughly 80% of the effects come from 20% of the causes.
It was also discovered that in general the 80% of a certain piece of software can be written in 20% of the total allocated time. Conversely, the hardest 20% of the code takes 80% of the time.
The KISS principle states that most systems work best if they are kept simple rather than made complicated; therefore, simplicity should be a key goal in design, and unnecessary complexity should be avoided.
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
Don’t repeat yourself (DRY, or sometimes do not repeat yourself) is a principle of software development aimed at reducing repetition of software patterns, replacing it with abstractions or using data normalization to avoid redundancy.
From: https://enterprisecraftsmanship.com/posts/dry-damp-unit-tests/
The DRY principle stands for “Don’t Repeat Yourself” and requires that any piece of domain knowledge has a single representation in your code base. In other words, in requires that you don’t duplicate the domain knowledge.
The DAMP principle stands for “Descriptive and Meaningful Phrases” and promotes the readability of the code.
Otherwise reject it.
When working with class or module sometimes you would need equal and opposite operations. The methods should be symmetric. Please make sure they are not added causally that would add non symmetric verbs.
If you are adding symmetric methods, then make sure they feel symmetric one.