Skip to content

Commit

Permalink
build: run linter on pull-requests
Browse files Browse the repository at this point in the history
Signed-off-by: JobaDiniz <jobertodinizjunior@gmail.com>
  • Loading branch information
JobaDiniz committed Oct 27, 2023
1 parent d928658 commit fb2caf8
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
e2e:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: linter

on:
pull_request:
branches: [develop]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
statuses: write
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper
# list of changed files within `super-linter`
fetch-depth: 0
- name: Lint Code Base
uses: super-linter/super-linter@v5
env:
VALIDATE_ALL_CODEBASE: true
VALIDATE_CSHARP: true
VALIDATE_YAML: true
VALIDATE_MARKDOWN: true
FILTER_REGEX_EXCLUDE: LICENSE.md
DEFAULT_BRANCH: develop
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
release:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)
![Build](https://github.com/IBM/ibm-rpa-cli/actions/workflows/build.yml/badge.svg)
[![Release](https://img.shields.io/github/v/release/IBM/ibm-rpa-cli?include_prereleases&sort=semver)](https://github.com/IBM/ibm-rpa-cli/releases/latest)
![](https://img.shields.io/github/downloads/IBM/ibm-rpa-cli/total?color=green&label=downloads)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

# IBM® RPA Command Line Interface

[![conventional commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-%23FE5196?logo=conventionalcommits&logoColor=white)](https://conventionalcommits.org)
[![linter](https://github.com/IBM/ibm-rpa-cli/actions/workflows/linter.yml/badge.svg)](https://github.com/marketplace/actions/super-linter)
![build](https://github.com/IBM/ibm-rpa-cli/actions/workflows/build.yml/badge.svg)
[![release](https://img.shields.io/github/v/release/IBM/ibm-rpa-cli?include_prereleases&sort=semver)](https://github.com/IBM/ibm-rpa-cli/releases/latest)
![downloads](https://img.shields.io/github/downloads/IBM/ibm-rpa-cli/total?color=green&label=downloads)
[![license: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

The IBM® RPA Command Line Interface (RPA CLI) is an *unofficial* tool that provides a interface to manage and deploy IBM® RPA projects.

## Documentation
Expand Down
2 changes: 1 addition & 1 deletion src/Joba.IBM.RPA.Cli/Environment/EnvironmentCommand.New.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public NewEnvironmentCommand() : base(CommandName, "Configures environments")
private async Task HandleAsync(RemoteOptions options, PropertyOptions properties, ILogger<EnvironmentCommand> logger,
IRpaClientFactory clientFactory, ISecretProvider secretProvider, IAccountAuthenticatorFactory authenticatorFactory,
IProject project, InvocationContext context) =>
await HandleAsync(options, properties, (ILogger)logger, clientFactory, secretProvider, authenticatorFactory, project, context);
await HandleAsync(options, properties, (ILogger)logger, clientFactory, secretProvider, authenticatorFactory, project, context);

public async Task HandleAsync(RemoteOptions options, PropertyOptions properties, ILogger logger,
IRpaClientFactory clientFactory, ISecretProvider secretProvider, IAccountAuthenticatorFactory authenticatorFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public PackageSourcesJsonConverterFactory(ProjectSettings projectSettings, UserS

public override bool CanConvert(Type typeToConvert) => typeof(IPackageSources).IsAssignableFrom(typeToConvert);

public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) =>
public override JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options) =>
projectSettings == null || userFile == null || userSettings == null
? new WriteJsonConverter()
: new ReadJsonConverter(projectSettings, userFile.Value, userSettings);
Expand Down
2 changes: 1 addition & 1 deletion src/Joba.IBM.RPA/Package/PackageManagerFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public interface IPackageManagerFactory
{
IPackageManager Create(IProject project, string? sourceAlias = null);
}

public sealed class PackageManagerFactory : IPackageManagerFactory
{
private readonly IRpaClientFactory clientFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public async Task UpdatePackageSourcesFile()
var config = new ServerConfig { Regions = new Region[] { region }, Version = RpaCommand.SupportedServerVersion, Deployment = DeploymentOption.SaaS, AuthenticationMethod = AuthenticationMethod.WDG };
var session = new CreatedSession { TenantCode = options.TenantCode!.Value, TenantName = "quality assurance" };
var credentials = new AccountCredentials(options.TenantCode!.Value, options.UserName!, options.Password!);
var console = new Mock<IConsole>();
var console = new Mock<IConsole>();
var client = new Mock<IRpaClient>();
client.Setup(c => c.GetConfigurationAsync(It.IsAny<CancellationToken>())).ReturnsAsync(config);
var clientFactory = new Mock<IRpaClientFactory>();
Expand Down

0 comments on commit fb2caf8

Please sign in to comment.