/// <summary> /// Creates a pull request comment. /// </summary> /// <param name="pullRequest">The <see cref="GitHubPullRequest"/> to comment on.</param> /// <param name="file">The <see cref="GitHubPullRequestFile"/> to comment on.</param> /// <param name="analyzer">The <see cref="ICodeAnalyzer"/> to use for finding violations.</param> /// <param name="physicalFilePath">The physical path of the file stored locally.</param> /// <returns> /// A <see cref="Task{TResult}"/> of <see cref="IEnumerable{T}"/> of <see cref="PullRequestReviewComment"/> /// representing the commenting operation. /// </returns> public override async Task<IEnumerable<PullRequestReviewComment>> Create(GitHubPullRequest pullRequest, GitHubPullRequestFile file, ICodeAnalyzer analyzer, string physicalFilePath) { if (pullRequest == null) { throw new ArgumentNullException("pullRequest"); } if (file == null) { throw new ArgumentNullException("file"); } var comments = new List<PullRequestReviewComment>(); if (file.Changes > 0) { var comment = new PullRequestReviewCommentCreate( "Renamed files not supported.", pullRequest.LastCommitId, file.FileName, 1); var addedComment = await this.Create(comment, pullRequest.Number); comments.Add(addedComment); } return comments; }
public SuppressionsSettings(ICodeAnalyzer.SuppressionStorage suppressionStorage, string projectBasePath = null, string projectName = null) { InitializeComponent(); suppressionsFilePath = ICodeAnalyzer.suppressionsFilePathByStorage(suppressionStorage, projectBasePath, projectName); SuppressionsInfo suppressionsInfo = new SuppressionsInfo(); suppressionsInfo.LoadFromFile(suppressionsFilePath); CppcheckLines.Items = suppressionsInfo.SuppressionLines; FilesLines.Items = suppressionsInfo.SkippedFilesMask; IncludesLines.Items = suppressionsInfo.SkippedIncludesMask; }
public EdmxProcessor( IOptionsMonitor <EdmxProcessorOptions> options, IAuthenticationProviderFactory authenticationProviderFactory, ILogger <EdmxProcessor> logger, IServiceProvider serviceProvider, ICodeAnalyzer codeAnalyzer) { if (options == null) { throw new ArgumentNullException(nameof(options)); } if (authenticationProviderFactory == null) { throw new ArgumentNullException(nameof(authenticationProviderFactory)); } this.options = options.CurrentValue; this.authProviderFactory = authenticationProviderFactory; this.log = logger; this.codeAnalyzer = codeAnalyzer; }
public TamerCode(ICodeRunner codeRunner, ICodeExecutor codeExecutor, ICodeAnalyzer codeAnalyzer) { _codeRunner = codeRunner; _codeExecutor = codeExecutor; _codeAnalyzer = codeAnalyzer; }
public HomeController(ILogger <HomeController> logger, ICodeAnalyzer codeAnalyzer, GameDataContext context) { _logger = logger; _codeAnalyzer = codeAnalyzer; _context = context; }
/// <summary> /// Creates a pull request comment. /// </summary> /// <param name="pullRequest">The <see cref="GitHubPullRequest"/> to comment on.</param> /// <param name="file">The <see cref="GitHubPullRequestFile"/> to comment on.</param> /// <param name="analyzer">The <see cref="ICodeAnalyzer"/> to use for finding violations.</param> /// <param name="physicalFilePath">The physical path of the file stored locally.</param> /// <returns> /// A <see cref="Task{TResult}"/> of <see cref="IEnumerable{T}"/> of <see cref="PullRequestReviewComment"/> /// representing the commenting operation. /// </returns> public abstract Task<IEnumerable<PullRequestReviewComment>> Create( GitHubPullRequest pullRequest, GitHubPullRequestFile file, ICodeAnalyzer analyzer, string physicalFilePath);
/// <summary> /// Does not do anything. /// </summary> /// <param name="pullRequest">The <see cref="GitHubPullRequest"/> to comment on.</param> /// <param name="file">The <see cref="GitHubPullRequestFile"/> to comment on.</param> /// <param name="analyzer">The <see cref="ICodeAnalyzer"/> to use for finding violations.</param> /// <param name="physicalFilePath">The physical path of the file stored locally.</param> /// <returns> /// A <see cref="Task{TResult}"/> of <see cref="IEnumerable{T}"/> of <see cref="PullRequestReviewComment"/> /// representing the commenting operation. /// </returns> /// <remarks> /// The result of <see cref="Task{TResult}"/> of <see cref="IEnumerable{T}"/> of <see cref="PullRequestReviewComment"/> /// will always be an empty enumeration. /// </remarks> public override Task<IEnumerable<PullRequestReviewComment>> Create( GitHubPullRequest pullRequest, GitHubPullRequestFile file, ICodeAnalyzer analyzer, string physicalFilePath) { using ( var task = new Task<IEnumerable<PullRequestReviewComment>>(() => new List<PullRequestReviewComment>())) { task.RunSynchronously(); return task; } }
public TypescriptCodeGenerator(IList <TestEntity> tests, IList <FunctionEntity> functions, ICodeAnalyzer analyzer, string?headerCode) { _analyzer = analyzer; _headerCode = headerCode ?? ""; SortedFunctions = new SortedSet <ImperativeFunction>(functions.Select(ToImperativeFunction)); TestsList = tests.Select(ToImperativeTest).ToList(); }
public CsharpCodeGenerator(IList <TestEntity> tests, IList <FunctionEntity> functions, ICodeAnalyzer analyzer, string?headerCode) { _analyzer = analyzer; _headerCode = headerCode ?? ""; SortedFunctions = new SortedSet <OoFunction>(functions.Select(ToOoFunction)); TestsList = tests.Select(ToOoTest).ToList(); }