Coder Social home page Coder Social logo

Comments (4)

cjprecord avatar cjprecord commented on May 22, 2024 1

Thanks for the consideration.

If I get some time, will try to look at submitting a patch

from pr-metrics.

muiriswoulfe avatar muiriswoulfe commented on May 22, 2024

Thanks @cjprecord for using PR Metrics and for filing your suggestion.

This is something that has been considered in the past, but to reduce the complexity – especially given the possibility of interference between multiple sets of globs and the need to define clear precedence rules – it was decided against adding this.

The other rationale is that it encourages the proper naming of code – i.e., that you don't put test in product code for instance.

To help determine whether we proceed with changing this and the proper level of prioritisation, I'd like to understand:

  • Why you have Test in the names of non-test files? If I saw SystemTest.cs, I would assume it was testing the system and therefore was test code.
  • If this is some form of testing that you don't want included, would it make sense to exclude this using the excluded files functionality?

from pr-metrics.

cjprecord avatar cjprecord commented on May 22, 2024

Hello,

Use of an optional regular expression string would work for this as well and probably be less complicated to existing functionality.

Depending on industry or codebase use there are a lot of cases where Test may appear in a file name that is not a test case. A big one for us is we have a lot of code that is used for mechanical or electrical control systems. Lots of components are used for 'self' tests, diagnostics, or literally running tests on the target systems or other diagnostic purposes and use of Test in the class/file names is very sensible and common.

Where these 'tests' are not tests for the code base being developed but tests that are performed on a target system, purpose of report on 'test' code should be for the code quality of the code being developed and not inflated by the 'tests' that the production code runs on other systems.

An exclude pattern could possibly work but would be more complicated to use in the projects we have. Typically we use a namespace / folder path structure to organize software tests code from production code, common example pattern is like this where all software test code is under an AutomatedTests folder

ModuleAlpha
AutomatedTests
ModuleAUT
ModuleBUT
ModuleA
ModuleB

from pr-metrics.

muiriswoulfe avatar muiriswoulfe commented on May 22, 2024

Thanks @cjprecord for the justification. I now believe it's viable for PR Metrics to support something like that.

The bad news is that we won't be able to prioritise this work anytime soon, but I am happy to support you implementing it if it is something you would be willing to take on.

As for the regular expression/glob possibilities, I really favour using a glob to keep the existing checks aligned. I believe switching between the two for different parameters will make the extension more difficult to consume.

from pr-metrics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.