A federal judge plans to rule in the latter half of September on whether the city can enforce a local law intended to insure that banks holding city deposits are meeting community investment needs—a law that bankers say would create a “cloud” over their industry.

Robert Giuffra Jr., a partner at Sullivan & Cromwell, said the 17 banks he represents already spend millions of dollars—if not tens of millions—to comply with the federal Community Reinvestment Act (CRA) and its state counterpart.